Skip to content

gtk-session: do not sync modifiers when focused

Olivier Fourdan requested to merge ofourdan/spice-gtk:modifiers-sync into master

Spice gtk-session would try to synchronize the modifiers state whenever the keymap changes, but doing so is inherently racy.

While the there is a keyboard grab in effect, all key events are forwarded to the guest, hence all modifiers key press get processed by the kernel on the guest.

Trying to synchronize the modifiers will generate additional key press/ release events which will result in the opposite effect and effectively desynchronize the modifier states in the guest.

Synchronizing modifiers from the host should therefore be limited to focus change, as actual press/release events might have occurred without the guest knowing. Otherwise, no need to synchronize the modifiers.

Edited by Olivier Fourdan

Merge request reports