aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/dix
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2016-07-03 22:52:13 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-07-05 08:38:36 +0200
commitcb0089bad114e79d5c6e4577da59fa8911d0ee8d (patch)
tree31d29fe44149a431af70d22afb8e3b73db31d8a0 /nx-X11/programs/Xserver/dix
parent9ea88717db376b54b2c821ab67e846918acc616a (diff)
downloadnx-libs-cb0089bad114e79d5c6e4577da59fa8911d0ee8d.tar.gz
nx-libs-cb0089bad114e79d5c6e4577da59fa8911d0ee8d.tar.bz2
nx-libs-cb0089bad114e79d5c6e4577da59fa8911d0ee8d.zip
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> Backport to nx-libs: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Diffstat (limited to 'nx-X11/programs/Xserver/dix')
-rw-r--r--nx-X11/programs/Xserver/dix/dispatch.c1
-rw-r--r--nx-X11/programs/Xserver/dix/events.c12
2 files changed, 4 insertions, 9 deletions
diff --git a/nx-X11/programs/Xserver/dix/dispatch.c b/nx-X11/programs/Xserver/dix/dispatch.c
index f799ce289..826adfb5c 100644
--- a/nx-X11/programs/Xserver/dix/dispatch.c
+++ b/nx-X11/programs/Xserver/dix/dispatch.c
@@ -3953,7 +3953,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/nx-X11/programs/Xserver/dix/events.c b/nx-X11/programs/Xserver/dix/events.c
index 4d1472cc8..6fefa512a 100644
--- a/nx-X11/programs/Xserver/dix/events.c
+++ b/nx-X11/programs/Xserver/dix/events.c
@@ -1546,14 +1546,6 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask,
return 1;
}
#endif
- 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))
{
#ifdef SMART_SCHEDULE
@@ -4442,6 +4434,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;
+
#ifdef XKB
if ((!noXkbExtension)&&(!XkbFilterEvents(pClient, count, events)))
return;