spice/client/x11
Hans de Goede 86e62813b3 spicec-x11: Fix modifier keys getting stuck (rhbz#655048)
Currently modifier keys (ctrl, alt) can get stuck when using the x11 client.
To reproduce under gnome:
-focus the client window without causing it to grab the keyborad (click on
 the title bar not the window)
-press crlt + alt + right arrow to switch virtual desktop
-press crlt + alt + left arrow to switch back
-notice ctrl + alt are stuck pressed

What is happening here is:
-We get a focus out event, caused by the hotkey combi key grab, focus event
 notify mode == NotifyGrab, and release all keys -> good
-We get another focus out event, as we really loose the focus.
 notify mode == NotifyWhileGrabbed, which we ignore as we already lost
 focus before
-We get a focus in event, as the focus is returning to us, but we don't
 really have the focus yet, as the hotkey combi key grab is still active
 (ie ctrl + alt are still pressed).
 We now sync the vm's modifier key state with the current X-server state,
 telling the vm ctrl + alt are pressed. Note we do this by directly reading
 the X-server keyboard status, we are not getting any key press events from the
 X-server -> bad
-We get another focus in event, as we really get the focus back,
 notify mode == NotifyUngrab. We ignore this one as already have gained the
 focus before. If we were to sync the vm modifier state here, all would be
 well we would no longer see the modifier keys pressed, or if we would we
 would get a release event when they get released (testing has shown both).

The solution here is to ignore the first focus in event, and do the modifier
sync on the second focus in event, or more in general to ignore focus events
where notify mode == NotifyWhileGrabbed.
2010-11-22 16:09:15 +01:00
..
images client: use spice icon instead-of solidice icon 2010-01-04 21:13:03 +02:00
.gitignore fresh start 2009-10-14 15:06:41 +02:00
atomic_count.h client: Include stdint.h for uint32_t 2010-09-29 12:44:33 +02:00
event_sources_p.cpp Replace epoll with select in X client 2010-10-12 13:43:44 +02:00
event_sources_p.h Replace epoll with select in X client 2010-10-12 13:43:44 +02:00
main.cpp client: Include config.h from common.h 2010-09-29 13:26:21 +02:00
Makefile.am spicec: add controller 2010-10-18 10:17:28 +02:00
named_pipe.cpp Fix spelling errors in comments and strings 2010-05-21 10:51:28 +02:00
named_pipe.h Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
pixels_source_p.h Make opengl optional, disabled by default 2010-06-21 14:50:18 +02:00
pixels_source.cpp Client: Support pixmap format conversion in copy_pixels 2010-04-23 16:39:13 +02:00
platform_utils.cpp Remove no longer used wstring_printf functions 2010-10-21 13:22:01 +02:00
platform_utils.h Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
platform.cpp spicec-x11: Listen for selection owner window destroy / close events too 2010-10-28 12:05:30 +02:00
playback.cpp Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
playback.h Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
record.cpp Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
record.h Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
red_drawable.cpp spicec-x11: Put locks around xlib calls which wait for a reply 2010-10-11 22:36:42 +02:00
red_pixmap_gl.cpp Move RedPixmap::Format to RedDrawable::Format 2010-04-23 16:36:35 +02:00
red_pixmap_sw.cpp Remove all mentions of "cairo" from the code 2010-05-03 12:38:02 +02:00
red_pixmap.cpp Make client canvas and pixmaps handle more formats and simplify 2010-04-23 16:36:35 +02:00
red_window_p.h spicec-x11: Do not set _NET_WM_USER_TIME to 0 on startup 2010-10-25 11:36:34 +02:00
red_window.cpp spicec-x11: Fix modifier keys getting stuck (rhbz#655048) 2010-11-22 16:09:15 +01:00
res.cpp Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
res.h Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
resource.h Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
x_icon.cpp spicec-x11: Put locks around xlib calls which wait for a reply 2010-10-11 22:36:42 +02:00
x_icon.h Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
x_platform.h Make opengl optional, disabled by default 2010-06-21 14:50:18 +02:00