aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/events.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-05-20 15:26:41 +0000
committermarha <marha@users.sourceforge.net>2010-05-20 15:26:41 +0000
commitf5fb2d27f1fd4976f0e77d97461a5e57ba6c9a23 (patch)
treec76e9cb708483e65b114c08ed008880f478cae15 /xorg-server/dix/events.c
parentb16c0295c9f95426980d567e93ae00c52545b3fa (diff)
parent3319741e6f9fc3232eb40462a261271b9af2dcb2 (diff)
downloadvcxsrv-f5fb2d27f1fd4976f0e77d97461a5e57ba6c9a23.tar.gz
vcxsrv-f5fb2d27f1fd4976f0e77d97461a5e57ba6c9a23.tar.bz2
vcxsrv-f5fb2d27f1fd4976f0e77d97461a5e57ba6c9a23.zip
svn merge "^/branches/released" .
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 7d8c1493f..d156cf3ed 100644
--- a/xorg-server/dix/events.c
+++ b/xorg-server/dix/events.c
@@ -1844,7 +1844,6 @@ int
TryClientEvents (ClientPtr client, DeviceIntPtr dev, xEvent *pEvents,
int count, Mask mask, Mask filter, GrabPtr grab)
{
- int i;
int type;
#ifdef DEBUG_EVENTS
@@ -1911,7 +1910,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)");
@@ -1932,7 +1930,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
@@ -1946,14 +1943,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)
@@ -4714,7 +4703,7 @@ ProcChangeActivePointerGrab(ClientPtr client)
if (rc != Success)
{
client->errorValue = stuff->cursor;
- return (rc == BadValue) ? BadCursor : rc;
+ return rc;
}
}
@@ -4837,7 +4826,7 @@ GrabDevice(ClientPtr client, DeviceIntPtr dev,
if (rc != Success)
{
client->errorValue = curs;
- return (rc == BadValue) ? BadCursor : rc;
+ return rc;
}
access_mode |= DixForceAccess;
}
@@ -5362,7 +5351,7 @@ ProcGrabButton(ClientPtr client)
if (rc != Success)
{
client->errorValue = stuff->cursor;
- return (rc == BadValue) ? BadCursor : rc;
+ return rc;
}
access_mode |= DixForceAccess;
}
@@ -5625,7 +5614,7 @@ ProcRecolorCursor(ClientPtr client)
if (rc != Success)
{
client->errorValue = stuff->cursor;
- return (rc == BadValue) ? BadCursor : rc;
+ return rc;
}
pCursor->foreRed = stuff->foreRed;
@@ -5675,6 +5664,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);