spice/client
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
..
gui spicec: Make cegui log to <app_data_dir>/cegui.log 2010-11-05 20:46:28 +01:00
tests/controller_test spicec-tests: add controller_test (v2) 2010-10-25 13:28:49 +02:00
windows spicec-win: ignore MSVCRT.lib in x86 build 2010-11-08 10:39:01 +02:00
x11 spicec-x11: Fix modifier keys getting stuck (rhbz#655048) 2010-11-22 16:09:15 +01:00
.gitignore gitignore: add generated_*, vim temps, pyc 2010-11-08 16:06:55 +02:00
application.cpp spicec: Don't show gui when connection info is specified on the cmdline 2010-11-09 13:03:58 +01:00
application.h spicec: Remove empty show / hide gui functions 2010-11-09 13:03:57 +01:00
audio_channels.h Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
audio_devices.h Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
cache.hpp Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
canvas_utils.cpp Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
canvas.cpp Client: Use the autogenerated demarshallers 2010-06-18 16:32:11 +02:00
canvas.h Remove unused method declarations 2010-07-08 14:19:45 +02:00
client_net_socket.cpp Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
client_net_socket.h Fix spelling errors in comments and strings 2010-05-21 10:51:28 +02:00
cmd_line_parser.cpp spicec: enable multiple CmdLineParser instantiations 2010-10-17 17:02:49 +02:00
cmd_line_parser.h Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
common.h client: Include config.h from common.h 2010-09-29 13:26:21 +02:00
controller.cpp spicec-win: remove redundent strdup & buggy free 2010-10-25 13:22:24 +02:00
controller.h controller: Make menu text utf-8 2010-10-25 11:36:35 +02:00
cursor_channel.cpp Make cursor data @as_ptr to avoid copying data 2010-06-18 20:27:32 +02:00
cursor_channel.h Make cursor data @as_ptr to avoid copying data 2010-06-18 20:27:32 +02:00
cursor.cpp Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
cursor.h Make all message structs internal to spice 2010-06-18 20:27:32 +02:00
debug.h Replace log4cpp with custom log function 2010-06-28 21:54:53 +02:00
demarshallers.h Generate marshaller/demarshallers for old protocol 2010-06-22 17:34:39 +02:00
display_channel.cpp Swap red and blue when decoding 0.4 mjpeg streams 2010-07-20 11:45:37 +02:00
display_channel.h detaching the screen when the primary surface is destoryed and closing the window if the primary surface is not recreated (the monitor has been detached). 2010-06-29 13:59:46 +02:00
event_sources.h Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
foreign_menu.cpp spicec: add foreign menu 2010-10-18 10:03:46 +02:00
foreign_menu.h spicec: add foreign menu 2010-10-18 10:03:46 +02:00
gdi_canvas.cpp Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
gl_canvas.cpp Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
glc.cpp Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
glz_decode_tmpl.c Fix spelling errors in comments and strings 2010-05-21 10:51:28 +02:00
glz_decoded_image.h Fix spelling errors in comments and strings 2010-05-21 10:51:28 +02:00
glz_decoder_config.h Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
glz_decoder_window.cpp spicec: Do not try to do accounting of pci memory 2010-10-09 22:27:53 +02:00
glz_decoder_window.h spicec: Do not try to do accounting of pci memory 2010-10-09 22:27:53 +02:00
glz_decoder.cpp Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
glz_decoder.h Move in spice/draw.h from spice-protocol to common/ 2010-07-08 13:56:01 +02:00
hot_keys.cpp Make CEGUI optional 2010-07-01 13:48:58 +02:00
hot_keys.h Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
icon.h Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
inputs_channel.cpp Fix various misspellings 2010-07-08 18:26:37 +02:00
inputs_channel.h Fix various misspellings 2010-07-08 18:26:37 +02:00
inputs_handler.h Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
jpeg_decoder.cpp JPEG support: introducing jpeg encoding for spice bitmaps 2010-06-09 11:40:25 +02:00
jpeg_decoder.h add eol after #ifdef in jpeg_encoder.h for n900 scratchbox compiler 2010-07-29 11:10:41 +03:00
lines.cpp Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
lz.cpp Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
Makefile.am spicec: add controller 2010-10-18 10:17:28 +02:00
marshaller.cpp Generate and link marshallers into client 2010-06-18 20:27:32 +02:00
marshallers.h Fix build error due to member "SpiceMsgEmpty" same name as type 2010-06-28 12:45:07 +02:00
mem.cpp Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
menu.cpp spicec: add menu id & find_sub() 2010-10-17 11:44:13 +02:00
menu.h spicec: add menu id & find_sub() 2010-10-17 11:44:13 +02:00
mjpeg_decoder.cpp client: Include config.h from common.h 2010-09-29 13:26:21 +02:00
mjpeg_decoder.h Swap red and blue when decoding 0.4 mjpeg streams 2010-07-20 11:45:37 +02:00
monitor.cpp Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
monitor.h Fix inclusion of common files, no need for common/ part 2010-07-08 15:44:15 +02:00
pixels_source.h Fix inclusion of common files, no need for common/ part 2010-07-08 15:44:15 +02:00
pixman_utils.cpp Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
platform.h spicec: Move setting of clipboard_owner to guest to platform code 2010-10-06 19:17:08 +02:00
playback_channel.cpp Make sound data @as_ptr to avoid copying data 2010-06-18 20:27:32 +02:00
process_loop.cpp spicec: add ProcessLoop::on_start_running() 2010-10-17 11:45:50 +02:00
process_loop.h spicec: add ProcessLoop::on_start_running() 2010-10-17 11:45:50 +02:00
quic.cpp Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
read_write_mutex.h Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
record_channel.cpp Convert client to use indirect calls for message marshalling 2010-06-22 10:54:59 +02:00
red_channel.cpp client: add verbose link error messages 2010-10-25 14:59:12 +02:00
red_channel.h Fix various misspellings 2010-07-08 18:26:37 +02:00
red_client.cpp client: Do not try to send display_config until we've received the agent caps 2010-10-18 10:40:51 +02:00
red_client.h spicec: name host param 2010-10-17 11:46:37 +02:00
red_drawable.h Add helper to compare RedDrawable::Formats for copy compabible 2010-04-23 16:36:35 +02:00
red_gdi_canvas.cpp applying zlib compression over glz on WAN connection 2010-06-21 15:05:37 +02:00
red_gdi_canvas.h Make client canvas and pixmaps handle more formats and simplify 2010-04-23 16:36:35 +02:00
red_gl_canvas.cpp applying zlib compression over glz on WAN connection 2010-06-21 15:05:37 +02:00
red_gl_canvas.h Remove all mentions of "cairo" from the code 2010-05-03 12:38:02 +02:00
red_key.h Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
red_peer.cpp Fix various misspellings 2010-07-08 18:26:37 +02:00
red_peer.h Fix various misspellings 2010-07-08 18:26:37 +02:00
red_pixmap_gdi.h Remove all mentions of "cairo" from the code 2010-05-03 12:38:02 +02:00
red_pixmap_gl.h Make client canvas and pixmaps handle more formats and simplify 2010-04-23 16:36:35 +02:00
red_pixmap_sw.h Remove all mentions of "cairo" from the code 2010-05-03 12:38:02 +02:00
red_pixmap.h Add RedDrawable::Format get_format() 2010-04-23 16:36:35 +02:00
red_sw_canvas.cpp applying zlib compression over glz on WAN connection 2010-06-21 15:05:37 +02:00
red_sw_canvas.h Remove all mentions of "cairo" from the code 2010-05-03 12:38:02 +02:00
red_types.h Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
red_window.h client: Interpret the title control message as utf8 instead of unicode16 2010-10-21 13:19:51 +02:00
region.cpp Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
rop3.cpp Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
screen_layer.cpp Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
screen_layer.h Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
screen.cpp client: Interpret the title control message as utf8 instead of unicode16 2010-10-21 13:19:51 +02:00
screen.h client: Interpret the title control message as utf8 instead of unicode16 2010-10-21 13:19:51 +02:00
shared_cache.hpp support for lossy images in the pixmap cache and fill bits 2010-06-09 11:41:01 +02:00
sw_canvas.cpp Remove all mentions of "cairo" from the code 2010-05-03 12:38:02 +02:00
threads.cpp client: Fall back to gettimeofday if clock_gettime not found 2010-09-29 13:35:18 +02:00
threads.h Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
tunnel_channel.cpp codegen: Various cleanups 2010-07-19 16:28:22 +02:00
tunnel_channel.h Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
utils.cpp Remove no longer used wstring_printf functions 2010-10-21 13:22:01 +02:00
utils.h Remove no longer used wstring_printf functions 2010-10-21 13:22:01 +02:00
zlib_decoder.cpp applying zlib compression over glz on WAN connection 2010-06-21 15:05:37 +02:00
zlib_decoder.h applying zlib compression over glz on WAN connection 2010-06-21 15:05:37 +02:00