Global menu support (via IPC)#2959
Conversation
Hi @dkondor, this sounds great! Regarding cairo-dock specifically though, some folks on chat have wondered about cairo-dock and while I know you have it working, I do not know which repos or branches you use for it. So, can you please say which cairo-dock repos and branches you use to have the 'best' cairo-dock experience on wayfire? |
My changes have been merged upstream, so it is best to use the official repositories: |
|
If this is added, I will support it in Panorama. |
|
@dkondor I don't think we should add all possible properties in There is a recent support for view properties, introduced in this PR: #2835 . I believe properties are a better fit for this use-case. You can set properties without a |
|
Hi, |
6733a4d to
646d2c9
Compare
|
Hi, I've updated the PR using properties as suggested + updated the example code: https://github.com/dkondor/gtk_global_menu/ -- now it includes a very minimal client that actually displays a menu bar. The only things that I could not figure out is whether it is possible to remove properties -- did I miss something? (Although in practice, it is not expected that clients remove these properties, so this is likely not an issue; note: the code style check is probably failing due to the TODO comment I left in there about this) |
There is no way to remove properties currently, but it should be easy to add a new method for this purpose. |
|
Looking at the code again, now I've realized that I could just use the erase_data function to delete a property :) @ammen99 do you still prefer to add a separate, |
Yes, I that would be better. |
ammen99
left a comment
There was a problem hiding this comment.
LGTM, we can merge after you add a method to delete properties (I assume you plan to do it?)
This allows apps to link their implementation of the com.canonical.dbusmenu DBus interface to their open views, implementing global menus.
This allows relaying these to clients
646d2c9 to
442eb28
Compare
OK, done! |
|
Just one more thing -- I've just noticed there is a capabilities event in the gtk-shell protocol which may be relevant. |
This will trigger GTK3 apps to export their menus via DBus.
OK, so apparently sending this event with the "global_menu_bar" value included will trigger GTK3 apps to export their menus via DBus, regardless of whether the appmenu-gtk-module is loaded. So I think it can be useful to optionally advertise it -- I've added a setting for it. |
|
Fixes #2367 (I already forgot about it) |
|
@dkondor The API/ABI change is bumped essentially every time I change something in the headers. It helps plugins also keep track of Wayfire's API if they want to. |
This is an alternative to #2576 that does not require any new Wayland protocol, so can be deployed as is. The downside is that the client displaying the global menus will need to use Wayfire's IPC as well, so will need a specialized implementation.
Note: currently, how this works is that the IPC plugins sends out the set of DBus properties whenever sending information about a view. This could be optimized by having a separate event for it, since these are not expected to change.
A simple test client is available here: https://github.com/dkondor/gtk_global_menu with basic instructions on how to make things work.
My medium-term plan is to add support in Cairo-Dock (although the Global-Menu plugin is still considered unstable and actually does not provide a nice user experience) which should be very easy to do. I might also look into creating a very simple layer-shell client that actually displays a menu bar (however, that might need something like what you did for wf-shell here to translate the dbusmenu objects to a menu model).