GNOME Bugzilla – Bug 753948
Nested X11: use KeymapNotify events to fix key state on FocusIn
Last modified: 2015-09-08 15:26:10 UTC
If the user Alt-Tabs out of the window, we will be left thinking the Alt key is still pressed since we don't see a release for it. Solve this and other related issues for the nested X11 compositor by selecting for KeymapStateMask which causes a KeymapNotify event to be sent after each FocusIn, and when we get these events, update the internal XKB state and send any necessary modifiers events to clients.
Created attachment 309840 [details] [review] Nested X11: use KeymapNotify events to fix key state on FocusIn
Review of attachment 309840 [details] [review]: Looks good. ::: src/backends/x11/meta-backend-x11.c @@ +280,3 @@ + /* Since we've selected for KeymapStateMask, every FocusIn is followed immediately + * by a KeymapNotify event */ + XMaskEvent(priv->xdisplay, KeymapStateMask, &xev); Jeez, that's an obscure Xlib call I've never heard of.
Attachment 309840 [details] pushed as 614d6bd - Nested X11: use KeymapNotify events to fix key state on FocusIn
Attachment 309840 [details] breaks non-wayland build: ./.libs/libmutter.so: undefined reference to `meta_wayland_compositor_update_key_state' ./.libs/libmutter.so: undefined reference to `meta_wayland_compositor_get_default'
Created attachment 310855 [details] [review] build: Fix non-wayland build This fixes build error caused by commit 614d6bd. We can simply remove the usage of meta-wayland.c functions in non-wayland build because META_BACKEND_X11_MODE_NESTED is only used in wayland.
Review of attachment 310855 [details] [review]: Looks good, thanks!
Attachment 310855 [details] pushed as 5066eaf - build: Fix non-wayland build