Commit graph

10 commits

Author SHA1 Message Date
Vladimir Panteleev
d18bf0f261 fix(swaybar/dbusmenu): cache icon lookups to avoid repeated filesystem access
Add caching for icon lookups in menu items. Two new fields are added to
the menu item struct:
- icon_surface: cached icon surface loaded from icon_name
- icon_lookup_done: tracks whether icon lookup has been attempted

The icon is now looked up once and cached, rather than performing
filesystem access every time the menu is drawn. The cached surface is
properly cleaned up when the menu is destroyed.
2026-04-17 20:10:00 +02:00
Vladimir Panteleev
33f2e590ed fix(swaybar/dbusmenu): properly destroy cairo surface for icon data
Properly destroy cairo surface for icon data when freeing dbusmenu
items.
2026-04-17 20:10:00 +02:00
Vladimir Panteleev
d4d295daf3 fix(swaybar/dbusmenu): fix null pointer dereference when loading icons
This change adds a null check when loading icons in the dbusmenu
code to avoid a segmentation fault when the icon surface fails to load.
2026-04-17 20:10:00 +02:00
blinxen
d550ece996 Rename dbusmenu functions to adhere to the style guide 2026-04-17 20:10:00 +02:00
blinxen
5e53b74295 Limit recursion depth when trying to find items under dbus menu 2026-04-17 20:10:00 +02:00
blinxen
70d5a6778b Initialize surface height with 0 before drawing 2026-04-17 20:10:00 +02:00
blinxen
7a1837eb3b Replace old usage of background-image.h
See https://github.com/swaywm/sway/pull/8405#discussion_r1817770755 and https://github.com/swaywm/sway/pull/8405#discussion_r1817770817
2026-04-17 20:10:00 +02:00
blinxen
40fffa3d27 Remove trailing whitespace 2026-04-17 20:10:00 +02:00
Giancarlo Razzolini
a5d85dfda1 Apply suggestions from code review
Co-authored-by: Demi Marie Obenour <demiobenour@gmail.com>
2026-04-17 20:10:00 +02:00
Felix Weilbach
86022e223d Tray: Implement dbusmenu
Co-authored-by: Ian Fan <ianfan0@gmail.com>
Co-authored-by: Nathan Schulte <nmschulte@gmail.com>

Signed-off-by: Felix Weilbach <felix.weilbach@t-online.de>
2026-04-17 20:10:00 +02:00