Skip to content

Use DBusMenuModel and DBusActionGroup for the window menu - #2893

Merged
leolost2605 merged 2 commits into
mainfrom
leolost/dbus-menu-model
Aug 12, 2026
Merged

Use DBusMenuModel and DBusActionGroup for the window menu#2893
leolost2605 merged 2 commits into
mainfrom
leolost/dbus-menu-model

Conversation

@leolost2605

@leolost2605 leolost2605 commented Aug 12, 2026

Copy link
Copy Markdown
Member

Currently we just pass the actions to the WindowManager but in a follow up we could remove perform_action (or at least most of it) from there and handle it directly in the WindowMenuManager.

@leolost2605

leolost2605 commented Aug 12, 2026

Copy link
Copy Markdown
Member Author

@lenemter this is what I meant in #2508 (comment)
Sorry that I didn't get to this earlier but I wanted to try it first because IMO it has some advantages:

  • we don't have to invent our own DBus Interface but can rely on a tried and tested one
  • we don't have to write our own UI which means the menu will look exactly like other menus in the system and it is less code to maintain

Also I think actions is a very good fit here since then, if we want to support plugin menu items, we don't have to deal with callbacks which often lead to memory leaks but can just provide an action and a label and we are done.

@leolost2605
leolost2605 force-pushed the leolost/dbus-menu-model branch 3 times, most recently from caedcd9 to 183cfad Compare August 12, 2026 13:27
@leolost2605
leolost2605 requested review from a team and lenemter August 12, 2026 13:29
@leolost2605
leolost2605 force-pushed the leolost/dbus-menu-model branch 2 times, most recently from 877f06a to fb99c84 Compare August 12, 2026 14:49

@lenemter lenemter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks move/resize menu items. Probably because when they're pressed, the gala-daemon window is focused. Maybe wrap on_move / on_resize into Idle for now, will that work?

@leolost2605

Copy link
Copy Markdown
Member Author

This breaks move/resize menu items. Probably because when they're pressed, the gala-daemon window is focused. Maybe wrap on_move / on_resize into Idle for now, will that work?

They are unfortunately already broken on main (at least for me). I double checked with this PR and set_grab_trigger is being called with the correct window so ig there is something wrong in set_grab_trigger. I would leave that to a follow up if that's ok

@leolost2605
leolost2605 force-pushed the leolost/dbus-menu-model branch from fb99c84 to 1a6ae2d Compare August 12, 2026 15:22

@lenemter lenemter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good. Thanks for taking on this :)

@leolost2605
leolost2605 force-pushed the leolost/dbus-menu-model branch from 1a6ae2d to 20035ad Compare August 12, 2026 16:10
@leolost2605
leolost2605 merged commit 4213fca into main Aug 12, 2026
7 checks passed
@leolost2605
leolost2605 deleted the leolost/dbus-menu-model branch August 12, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants