summaryrefslogtreecommitdiff
path: root/xkb/xkbEvents.c
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2011-05-03 03:20:23 +0100
committerPeter Hutterer <peter.hutterer@who-t.net>2011-05-06 13:15:28 +1000
commit3231962db826f5efd431596a309c96e907a191d1 (patch)
treed8572dcd7950fed82ea454e6dc00dc037e82cd0a /xkb/xkbEvents.c
parent460a377ef2d645d9ae38a8356fb248ccc47bed4a (diff)
XKB: Fix sense inversion for core MapNotify events
Due to an unfortunate sense inversion incident while switching from a if (foo) { ... } to if (!foo) continue; style in f06a9d, we punished any client who attempted to use XKB to restrict the MapNotify events they wanted by sending them exactly the events they _didn't_ want, and nothing else. NewKeyboardNotifies (coming from a client setting the map with an XKB request, when switching between master devices, etc) weren't affected, but this would impact anyone using xmodmap-style core requests. Could explain a fair bit. Clarified the comments while I was at it. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'xkb/xkbEvents.c')
-rw-r--r--xkb/xkbEvents.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/xkb/xkbEvents.c b/xkb/xkbEvents.c
index d342acc28..dfbf7f2b3 100644
--- a/xkb/xkbEvents.c
+++ b/xkb/xkbEvents.c
@@ -88,11 +88,15 @@ XkbSendLegacyMapNotify(DeviceIntPtr kbd, CARD16 xkb_event, CARD16 changed,
if (!clients[i] || clients[i]->clientState != ClientStateRunning)
continue;
- /* Ignore clients which will have already received this.
- * Inconsistent with themselves, but consistent with previous
- * behaviour.*/
- if (xkb_event == XkbMapNotify && (clients[i]->mapNotifyMask & changed))
+ /* XKB allows clients to restrict the MappingNotify events sent to
+ * them. This was broken for three years. Sorry. */
+ if (xkb_event == XkbMapNotify &&
+ (clients[i]->xkbClientFlags & _XkbClientInitialized) &&
+ !(clients[i]->mapNotifyMask & changed))
continue;
+ /* Emulate previous server behaviour: any client which has activated
+ * XKB will not receive core events emulated from a NewKeyboardNotify
+ * at all. */
if (xkb_event == XkbNewKeyboardNotify &&
(clients[i]->xkbClientFlags & _XkbClientInitialized))
continue;