diff options
author | Jamey Sharp <jamey@minilop.net> | 2010-05-15 13:12:44 -0700 |
---|---|---|
committer | Jamey Sharp <jamey@minilop.net> | 2010-05-19 12:32:34 -0700 |
commit | 8033fb6c9792820a82fbdff6a14ff8a7a141ba74 (patch) | |
tree | 8e9d073e08028f46e5b8c725a029bc8f41c216fc /dix | |
parent | 4b9600a4167427a8fe88bca9b738c9a99cac9469 (diff) |
Set event sequence number in WriteEventsToClient instead of at callers.
TryClientEvents already did this; this commit just moves the assignment
one level down so that no event source has to worry about sequence
numbers.
...No event source, that is, except XKB, which inexplicably calls
WriteToClient directly for several events.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'dix')
-rw-r--r-- | dix/dispatch.c | 1 | ||||
-rw-r--r-- | dix/events.c | 15 | ||||
-rw-r--r-- | dix/inpututils.c | 1 |
3 files changed, 4 insertions, 13 deletions
diff --git a/dix/dispatch.c b/dix/dispatch.c index fe9ddb2a8..c9e3188cc 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -3741,7 +3741,6 @@ SendErrorToClient(ClientPtr client, unsigned majorCode, unsigned minorCode, memset(&rep, 0, sizeof(xError)); rep.type = X_Error; - rep.sequenceNumber = client->sequence; rep.errorCode = errorCode; rep.majorCode = majorCode; rep.minorCode = minorCode; diff --git a/dix/events.c b/dix/events.c index a00ecd9fa..39ad4007c 100644 --- a/dix/events.c +++ b/dix/events.c @@ -1841,7 +1841,6 @@ int TryClientEvents (ClientPtr client, DeviceIntPtr dev, xEvent *pEvents, int count, Mask mask, Mask filter, GrabPtr grab) { - int i; int type; #ifdef DEBUG_EVENTS @@ -1908,7 +1907,6 @@ TryClientEvents (ClientPtr client, DeviceIntPtr dev, xEvent *pEvents, { xEvent release = *pEvents; release.u.u.type = KeyRelease; - release.u.u.sequenceNumber = client->sequence; WriteEventsToClient(client, 1, &release); #ifdef DEBUG_EVENTS ErrorF(" (plus fake core release for repeat)"); @@ -1929,7 +1927,6 @@ TryClientEvents (ClientPtr client, DeviceIntPtr dev, xEvent *pEvents, { deviceKeyButtonPointer release = *(deviceKeyButtonPointer *)pEvents; release.type = DeviceKeyRelease; - release.sequenceNumber = client->sequence; #ifdef DEBUG_EVENTS ErrorF(" (plus fake xi1 release for repeat)"); #endif @@ -1943,14 +1940,6 @@ TryClientEvents (ClientPtr client, DeviceIntPtr dev, xEvent *pEvents, } } - type &= 0177; - if (type != KeymapNotify) - { - /* all extension events must have a sequence number */ - for (i = 0; i < count; i++) - pEvents[i].u.u.sequenceNumber = client->sequence; - } - if (BitIsOn(criticalEvents, type)) { if (client->smart_priority < SMART_MAX_PRIORITY) @@ -5672,6 +5661,10 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events) if (!pClient || pClient == serverClient || pClient->clientGone) return; + for (i = 0; i < count; i++) + if ((events[i].u.u.type & 0x7f) != KeymapNotify) + events[i].u.u.sequenceNumber = pClient->sequence; + /* Let XKB rewrite the state, as it depends on client preferences. */ XkbFilterEvents(pClient, count, events); diff --git a/dix/inpututils.c b/dix/inpututils.c index e3b44fc08..8e7537250 100644 --- a/dix/inpututils.c +++ b/dix/inpututils.c @@ -88,7 +88,6 @@ do_butmap_change(DeviceIntPtr dev, CARD8 *map, int len, ClientPtr client) if (!XIShouldNotify(clients[i], dev)) continue; - core_mn.u.u.sequenceNumber = clients[i]->sequence; WriteEventsToClient(clients[i], 1, &core_mn); } |