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 665215 - ctrl+alt+tab does not work on some machines
ctrl+alt+tab does not work on some machines
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
3.2.x
Other Linux
: Normal normal
: ---
Assigned To: Rui Matos
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-11-30 16:01 UTC by Paolo Borelli
Modified: 2012-03-13 19:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
display: Add accessor function for ignored_modifier_mask (1.85 KB, patch)
2012-03-13 15:28 UTC, Florian Müllner
committed Details | Review
main: Ignore some modifiers when matching events to keybindings (1.24 KB, patch)
2012-03-13 15:29 UTC, Florian Müllner
committed Details | Review

Description Paolo Borelli 2011-11-30 16:01:34 UTC
I have two F16 installs, on one the ctrl+alt+tab popup works fine, on the other it pops up, but when you release the keys it is not dismissed and the current item is not selected. You can just dismiss the popup with esc.

It is like the key-release-event is not detected.

Other people on gnome-shell are seeing the same issu.
Comment 1 Jasper St. Pierre (not reading bugmail) 2011-11-30 16:05:29 UTC
Debugging this on IRC:

It seems that the problem is related to Num Lock. Turning Num Lock on means that Mod2 is on all the time. For some reason, in the overview, this._modifierMask is 16, which is the value of Mod2Mask.

I want to point out that this makes the Ctrl+Alt+Tab dialog inaccessible on some laptops. My laptop has "num lock" on all the time, and the "num lock" key is a hardware switch that switches the values that the right side of the keyboard sends.
Comment 2 Owen Taylor 2011-11-30 16:50:28 UTC
In general, one should always assume there may be modifier bits which are "irrelevant" - so 'event.state == <something>' is basically always wrong - you either want to do 

 (event.state & <something>) != 0

Or occasionally

 (event.state & mask) == <something>

See gdk_get_modifier_mask() (or 3.4 - gdk_keymap_get_modifier_mask()) for the the value of "mask" - but in many cases the first version if good enough.
Comment 3 Jasper St. Pierre (not reading bugmail) 2011-11-30 16:56:47 UTC
We do. The mask that we use is the primary modifier of the keybinding. For some reason, this happens to be Mod2Mask (16) when activating the keybinding  in the overview. Outside of the overview, it's Mod1Mask (8), which is correct.
Comment 4 Florian Müllner 2011-12-01 13:10:12 UTC
I'm pretty sure the error is somewhere lower in the stack. I was not able to reproduce the issue until a system update[0] (ibus would look like a good candidate, but I'm not using it). The password entries of the lock screen and the (old) nm-applet password dialogs show a warning that num-lock is pressed (though it is not).


[0] glibc-common glibc imsettings-libs ibus-libs im-chooser im-chooser-common imsettings imsettings-gnome openssh ibus-gtk2 ibus-gtk3 ibus authconfig glusterfs graphviz graphviz-gd rest libsocialweb-keys libsocialweb folks kernel-headers glibc-headers dracut glibc-devel empathy glusterfs-fuse authconfig-gtk openssh-clients openssh-server im-chooser-xfce augeas-libs checkpolicy dosfstools dvb-apps fcoe-utils kernel-tools libass libffado libwps mcelog pinpoint setroubleshoot-plugins kernel
Comment 5 Florian Müllner 2012-03-13 15:28:37 UTC
Created attachment 209614 [details] [review]
display: Add accessor function for ignored_modifier_mask

Some modifiers like NumLock and ScrollLock don't make sense in
keybindings, which is why we ignore them when matching keybindings
to events. We should do the same in Javascript, so add an accessor
function.
Comment 6 Florian Müllner 2012-03-13 15:29:01 UTC
Created attachment 209615 [details] [review]
main: Ignore some modifiers when matching events to keybindings

Some modifiers like NumLock or ScrollLock don't make sense in
keybindings, which is why we ignore them in mutter when matching
events to keybindings; for keybindings in the overview, we do
the matching ourselves, so filter the same modifiers as mutter.
Comment 7 Florian Müllner 2012-03-13 15:31:17 UTC
I still have no idea why NumLock appears pressed although it is not, but it does not matter if we fix the bug that is clearly on our side, e.g. the fact that we don't ignore those modifiers in the first place (like we do in mutter/metacity).
Comment 8 Rui Matos 2012-03-13 19:11:29 UTC
Review of attachment 209614 [details] [review]:

Other than the comment looks good.

::: src/meta/display.h
@@ +92,3 @@
 guint32 meta_display_get_current_time_roundtrip (MetaDisplay *display);
 
+unsigned long meta_display_get_ignored_modifier_mask (MetaDisplay  *display);

Probably not a problem in practice, but ignored_modifier_mask is defined as an unsigned int.

In JS, bitwise operations seem to always force their operands into 32 bits anyway.
Comment 9 Rui Matos 2012-03-13 19:12:22 UTC
Review of attachment 209615 [details] [review]:

Looks good although I can't really say if this fixes the bug since I've never experienced it.
Comment 10 Florian Müllner 2012-03-13 19:34:39 UTC
Comment on attachment 209614 [details] [review]
display: Add accessor function for ignored_modifier_mask

Attachment 209614 [details] pushed as 5361e02 - display: Add accessor function for ignored_modifier_mask

Pushed with s/long/int/ - good catch!
Comment 11 Florian Müllner 2012-03-13 19:35:40 UTC
Attachment 209615 [details] pushed as 93a004b - main: Ignore some modifiers when matching events to keybindings