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>
This commit is contained in:
Daniel Stone 2011-05-03 03:20:23 +01:00 committed by Peter Hutterer
parent 460a377ef2
commit 3231962db8

View File

@ -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;