Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT: proof of concept for global menus #2569

Closed
wants to merge 4 commits into from

Conversation

dkondor
Copy link
Contributor

@dkondor dkondor commented Jan 31, 2025

Partially addresses #2367

This is a draft so far, since the functionality is very basic and only works for GTK3 apps. I would eventually prefer exposing this via the wlr-foreign-toplevel-management protocol.

So far, this allows reporting the DBus properties set by gtk-shell to IPC clients (new event: view-gtk-dbus-properties-changed).

So far I've included an example client that displays the menus of the active app: wf_gtk_global_menu.py (once this PR is closer to ready, I'd move this to a separate repo, or open a separate PR in pywayfire).
Currently, this only works with GTK3 apps. To use this:

  1. Install appmenu-gtk3-module
  2. Run python3 wf_gtk_global_menu.py (it needs to start before any app whose menu to show)
  3. Start a GTK3 app with setting the environment variable GTK_MODULES=appmenu-gtk-module
  4. Focus the app (you might need to change focus for things to work); its app-id should show up in the "Active app" field
  5. Select "Show menu"

Next steps:

  • add also the KDE appmenu protocol (it would allow global menus for Qt apps)
  • experiment with adding a new event for the wlr-foreign-toplevel-management protocol (similar to this) to make using this easier for panels without relying on Wayfire's IPC
  • likely this would require storing the properties (app_menu_path, menubar_path, etc.) so they can be reported for already running apps as well

@soreau
Copy link
Member

soreau commented Jan 31, 2025

If I understand correctly, here is some prior art, pre-ipc era: https://github.com/soreau/wf-extra-protos

@dkondor
Copy link
Contributor Author

dkondor commented Feb 1, 2025

If I understand correctly, here is some prior art, pre-ipc era: https://github.com/soreau/wf-extra-protos

Thanks for looking into this! I think these are orthogonal, since here the menu content is supplied by the app; see also e.g. Alexays/Waybar#288

@soreau
Copy link
Member

soreau commented Feb 1, 2025

Thanks for looking into this! I think these are orthogonal, since here the menu content is supplied by the app; see also e.g. Alexays/Waybar#288

That seems like a nice concept! I at least know that users want right-click menu functionality whether it be on the desktop, window titlebar or even the taskbar/window-list with more than just minimize/maximize/close (like send window to workspace or desktop menu change workspace).

@dkondor I would like to take this opportunity to thank you for all of your contributions. They help make wayfire continuously better. Keep up the good work!

@dkondor
Copy link
Contributor Author

dkondor commented Feb 13, 2025

Closing in favor of #2576

@dkondor dkondor closed this Feb 13, 2025
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