GNOME Bugzilla – Bug 787407
wayland: gtk_shell1 capability enumeration badly numbered
Last modified: 2018-05-02 19:04:31 UTC
The gtk_shell1 Wayland protocol declares the following enumeration: <enum name="capability"> <entry name="global_app_menu" value="1"/> <entry name="global_menu_bar" value="2"/> <entry name="desktop_icons" value="3"/> </enum> These constants are then used to mask off bits in the value sent by the "capabilities" event in order to convert them to GdkScreen settings. This is fine for the first two, but it means the "gtk-shell-shows-desktop" setting will only be set if global_app_menu and global_menu_bar are set. Presumably desktop_icons should be set to 4? From the look of the mutter source code, it only ever sends the global_app_menu capability. So I guess this particular code path never gets tested.
Sounds right to me. Thanks for finding this!
Created attachment 359670 [details] [review] wayland/protocol/gtk-shell: Fix flag enumerator desktop_icons should have the value 4 so that it’s an independent flag. Until now, it was 3, which was the union of the other two enumerators.
As part of this, does the protocol version need bumped or anything else? Asking as Georges is about to do that in master, anyway: https://git.gnome.org/browse/gtk+/commit/?h=wip/gbsneto/edge-constraints&id=b79ec084a5794292a2b82a6cf4a6a2ccac83a412
I don't think so - this was clearly just a bug making the interface unusable for this aspect. But maybe Jonas has a different opinion. Jonas ?
Versioning alone wouldn't help unless we turn this into a backwards compatible change (eg. adding an extra value, deprecating the current =3 one). But I don't think it matters much in practice since mutter doesn't ever set desktop_icons... we could as well just fix the value, and add a comment in src/wayland/meta-wayland-gtk-shell.c, bind_gtk_shell() that desktop_icons should be only sent on version>1.
Now the protocol is shell2 in both GTK+ 3 and 4, as edge constraints landed in both. It would be good to decide if we can fix this in v2, or need a v3 for it.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/905.