aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/events.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/dix/events.c')
-rw-r--r--xorg-server/dix/events.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/xorg-server/dix/events.c b/xorg-server/dix/events.c
index a537730a9..d68eeee62 100644
--- a/xorg-server/dix/events.c
+++ b/xorg-server/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)
@@ -4708,7 +4697,7 @@ ProcChangeActivePointerGrab(ClientPtr client)
if (rc != Success)
{
client->errorValue = stuff->cursor;
- return (rc == BadValue) ? BadCursor : rc;
+ return rc;
}
}
@@ -4831,7 +4820,7 @@ GrabDevice(ClientPtr client, DeviceIntPtr dev,
if (rc != Success)
{
client->errorValue = curs;
- return (rc == BadValue) ? BadCursor : rc;
+ return rc;
}
access_mode |= DixForceAccess;
}
@@ -5356,7 +5345,7 @@ ProcGrabButton(ClientPtr client)
if (rc != Success)
{
client->errorValue = stuff->cursor;
- return (rc == BadValue) ? BadCursor : rc;
+ return rc;
}
access_mode |= DixForceAccess;
}
@@ -5619,7 +5608,7 @@ ProcRecolorCursor(ClientPtr client)
if (rc != Success)
{
client->errorValue = stuff->cursor;
- return (rc == BadValue) ? BadCursor : rc;
+ return rc;
}
pCursor->foreRed = stuff->foreRed;
@@ -5669,6 +5658,13 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events)
int i,
eventlength = sizeof(xEvent);
+ 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);