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 733562 - evdev: update xkb_state when resuming input
evdev: update xkb_state when resuming input
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: general
unspecified
Other Mac OS
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks:
 
 
Reported: 2014-07-22 14:13 UTC by Carlos Garnacho
Modified: 2014-07-23 12:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
evdev: Update xkb state after input is resumed (4.82 KB, patch)
2014-07-22 14:14 UTC, Carlos Garnacho
committed Details | Review

Description Carlos Garnacho 2014-07-22 14:13:13 UTC
In the gap that happens when input is suspended/resumed, the currently pressed modifiers might have changed in between. As xkb_state is really sensitive to double sets/unsets, those wouldn't go away easily, so I'd propose to just redo the xkb_state from scratch, keeping only latched/locked modifiers around, just like happens on keymap changes.

This is somewhat hindering on VT switch in native mutter, as the VT switch combo involves Ctrl and Alt, so those remain stubbornly "pressed" if you switch back and the keys are released at the time the compositor takes control of devices.

I'm attaching a patch implementing that.
Comment 1 Carlos Garnacho 2014-07-22 14:14:00 UTC
Created attachment 281386 [details] [review]
evdev: Update xkb state after input is resumed

xkb_state creation has been refactored out of clutter_evdev_set_keyboard_map(),
and used too in clutter_evdev_reclaim_devices(), so the xkb_state is fresh
clean after input is paused/resumed (and keyboard state possibly changed in
between)
Comment 2 Rui Matos 2014-07-22 16:29:03 UTC
Review of attachment 281386 [details] [review]:

Looks fine to me. I'll leave the final word to Emmanuele
Comment 3 Emmanuele Bassi (:ebassi) 2014-07-22 16:33:23 UTC
Review of attachment 281386 [details] [review]:

looks good.
Comment 4 Carlos Garnacho 2014-07-23 12:31:42 UTC
Attachment 281386 [details] pushed as 9e8c92d - evdev: Update xkb state after input is resumed