Bug 1213113

Summary: control-center keyboard shortcut editor does not see super key (under wayland)
Product: [Fedora] Fedora Reporter: Zbigniew Jędrzejewski-Szmek <zbyszek>
Component: mutterAssignee: Florian Müllner <fmuellner>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: agrover, control-center-maint, fmuellner, kem, leho, mkasik, ofourdan, oholy, otaylor, rstrode, tiagomatos, walters
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: gnome-shell-3.24.2-1.fc26.x86_64 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-07-25 22:37:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Zbigniew Jędrzejewski-Szmek 2015-04-19 00:15:35 UTC
Description of problem:
When trying to add a keyboard shortcut under wayland, using "super" key as modifier does not work, and control center behaves as if the key was not pressed at all.

I usually bind super+enter to terminal, and control-center refuses to create the shortcut, complaining that enter cannot be used in the shortcut alone. When I try to bind it with another modifier (e.g. super+alt+enter), it proceeeds, but the shortcut is created without super (alt+enter).

*Using* shortcut with super as modifier works though without any trouble.

Version-Release number of selected component (if applicable):
gnome-session-wayland-session-3.16.0-1.fc22.x86_64
control-center-3.16.0-1.fc22.x86_64
xorg-x11-server-Xwayland-1.17.1-7.fc22.x86_64

How reproducible:
100% on this machine.

Comment 2 Olivier Fourdan 2015-04-20 13:47:36 UTC
I reckon this is a mutter issue.

mutter seems to have a "grab" on Super, and it won't pass events down to Wayland for those, meaning that Xwayland will not be notified of Super key press events and therefore won't apply the modifier mask accordingly.

This is in mutter/core/events.c:

https://git.gnome.org/browse/mutter/tree/src/core/events.c#n310  

155 static gboolean
156 meta_display_handle_event (MetaDisplay        *display,
157                            const ClutterEvent *event)
158 {
[...]
302   /* If the compositor has a grab, don't pass that through to Wayland */
303   if (display->event_route == META_EVENT_ROUTE_COMPOSITOR_GRAB)
304     bypass_wayland = TRUE;
305 
306   /* If a Wayland client has a grab, don't pass that through to Clutter */
307   if (display->event_route == META_EVENT_ROUTE_WAYLAND_POPUP)
308     bypass_clutter = TRUE;
309 
310 #ifdef HAVE_WAYLAND
311   if (compositor /* && !bypass_wayland */)
312     {
313       if (meta_wayland_compositor_handle_event (compositor, event))
314         bypass_clutter = TRUE;
315     }
316 #endif

When pressing the "Super" key, bypass_wayland is TRUE and meta_wayland_compositor_handle_event() is not called.

As a proof of concept, for debugging purpose, removing that "!bypass_wayland" fixes the issue, Xwayland correctly report the modifier mask in the button press/release events - Obviously, this is not the correct fix, but it shows the issue is not in control-center nor in Xwayland.

Moving to mutter for further investigation.

Comment 3 Leho Kraav 2016-06-27 12:42:36 UTC
Confirming, this is real and messing with the workstation setup. I'm currently on gnome-3.18, did anything with this bug improve perhaps as a side-effect in gnome-3.20 or later?

Comment 4 Zbigniew Jędrzejewski-Szmek 2016-06-28 14:58:21 UTC
In gnome 3.20 (gnome-shell-3.20.2-1.fc24.x86_64) this seems to be improved. Behaviour is still slightly erratic: some bindings are successfully created in the "Keyboard" dialog, others aren't. I think that if there is an existing binding, it gets executed before "Keyboard" sees it. I would expect instead to see a notification that this binding is already bound. Nevertheless, situation is greatly improved, I'd say that this is 80% fixed.

Comment 5 Fedora End Of Life 2016-07-19 13:46:23 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 6 Andy Grover 2016-08-01 23:04:35 UTC
This is still a problem in Fedora 24. I have emacs bindings to super-e and super-q and emacs is just seeing e and q.

Comment 7 Andy Grover 2016-08-03 18:48:46 UTC
It looks like Super_R is getting through, but not Super_L. I would guess bypass_wayland isn't being set not because of a grab, but because of something inside the call to meta_keybindings_process_event, maybe process_key_event -> process_overlay_key, since Super_L is the overlay key.

Comment 8 Fedora End Of Life 2017-07-25 18:53:49 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 9 Zbigniew Jędrzejewski-Szmek 2017-07-25 22:35:55 UTC
Seems even better in F26... I think it's OK to let this go EOL.

Comment 10 Zbigniew Jędrzejewski-Szmek 2017-07-25 22:37:12 UTC
... or even to just close it.