diff options
author | Olivier Fourdan <ofourdan@redhat.com> | 2015-01-05 16:44:22 +0100 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2015-01-07 09:22:12 +1000 |
commit | 43014795087a0a8774dd9687f5967329b15f06a2 (patch) | |
tree | 2377abf7960160ceceec93338a1748b46b4a431c /hw/kdrive/ephyr/ephyr.c | |
parent | 24b943132f90bc72ce8b5dc954fe9ee8484edfc2 (diff) |
Synchronize capslock in Xnest and Xephyr
In Xnest or Xephyr, pressing CapsLock when focus is on another
window does not update the state in the nested X server.
This is because when synchronizing the lock modifier, sending a
keypress or a key release only is not sufficient to toggle the state,
unlike regular modifiers, one has to emulate a full press/release
to lock or unlock the modifier.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'hw/kdrive/ephyr/ephyr.c')
-rw-r--r-- | hw/kdrive/ephyr/ephyr.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c index 907bbebae..164ebdcba 100644 --- a/hw/kdrive/ephyr/ephyr.c +++ b/hw/kdrive/ephyr/ephyr.c @@ -806,7 +806,11 @@ ephyrUpdateModifierState(unsigned int state) for (key = 0; key < MAP_LENGTH; key++) if (keyc->xkbInfo->desc->map->modmap[key] & mask) { - if (key_is_down(pDev, key, KEY_PROCESSED)) + if (mask == XCB_MOD_MASK_LOCK) { + KdEnqueueKeyboardEvent(ephyrKbd, key, FALSE); + KdEnqueueKeyboardEvent(ephyrKbd, key, TRUE); + } + else if (key_is_down(pDev, key, KEY_PROCESSED)) KdEnqueueKeyboardEvent(ephyrKbd, key, TRUE); if (--count == 0) @@ -820,6 +824,8 @@ ephyrUpdateModifierState(unsigned int state) for (key = 0; key < MAP_LENGTH; key++) if (keyc->xkbInfo->desc->map->modmap[key] & mask) { KdEnqueueKeyboardEvent(ephyrKbd, key, FALSE); + if (mask == XCB_MOD_MASK_LOCK) + KdEnqueueKeyboardEvent(ephyrKbd, key, TRUE); break; } } |