After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 787407 - wayland: gtk_shell1 capability enumeration badly numbered
wayland: gtk_shell1 capability enumeration badly numbered
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Backend: Wayland
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2017-09-07 12:25 UTC by James Henstridge
Modified: 2018-05-02 19:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wayland/protocol/gtk-shell: Fix flag enumerator (1.07 KB, patch)
2017-09-12 21:29 UTC, Daniel Boles
none Details | Review

Description James Henstridge 2017-09-07 12:25:58 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.
Comment 1 Matthias Clasen 2017-09-07 20:22:08 UTC
Sounds right to me. Thanks for finding this!
Comment 2 Daniel Boles 2017-09-12 21:29:33 UTC
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.
Comment 3 Daniel Boles 2017-09-19 15:32:16 UTC
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
Comment 4 Matthias Clasen 2017-09-19 19:23:10 UTC
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 ?
Comment 5 Carlos Garnacho 2017-09-20 10:01:48 UTC
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.
Comment 6 Daniel Boles 2017-10-14 11:50:33 UTC
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.
Comment 7 GNOME Infrastructure Team 2018-05-02 19:04:31 UTC
-- 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.