Backport 8033fb6c9792820a82f

This commit is contained in:
Lauri Kasanen 2015-02-27 18:20:10 +02:00
parent f2935fa50e
commit 2d5ee280e6
11 changed files with 5 additions and 41 deletions

View File

@ -499,15 +499,9 @@ int state;
Bool forced; Bool forced;
{ {
ScreenSaverScreenPrivatePtr pPriv; ScreenSaverScreenPrivatePtr pPriv;
ScreenSaverEventPtr pEv; ScreenSaverEventPtr pEv;
unsigned long mask; unsigned long mask;
xScreenSaverNotifyEvent ev; xScreenSaverNotifyEvent ev;
ClientPtr client;
int kind; int kind;
UpdateCurrentTimeIf(); UpdateCurrentTimeIf();
@ -525,20 +519,16 @@ Bool forced;
else else
kind = ScreenSaverInternal; kind = ScreenSaverInternal;
for (pEv = pPriv->events; pEv; pEv = pEv->next) { for (pEv = pPriv->events; pEv; pEv = pEv->next) {
client = pEv->client;
if (client->clientGone)
continue;
if (!(pEv->mask & mask)) if (!(pEv->mask & mask))
continue; continue;
ev.type = ScreenSaverNotify + ScreenSaverEventBase; ev.type = ScreenSaverNotify + ScreenSaverEventBase;
ev.state = state; ev.state = state;
ev.sequenceNumber = client->sequence;
ev.timestamp = currentTime.milliseconds; ev.timestamp = currentTime.milliseconds;
ev.root = WindowTable[pScreen->myNum]->drawable.id; ev.root = WindowTable[pScreen->myNum]->drawable.id;
ev.window = savedScreenInfo[pScreen->myNum].wid; ev.window = savedScreenInfo[pScreen->myNum].wid;
ev.kind = kind; ev.kind = kind;
ev.forced = forced; ev.forced = forced;
WriteEventsToClient(client, 1, (xEvent *) &ev); WriteEventsToClient(pEv->client, 1, (xEvent *) &ev);
} }
} }

View File

@ -838,15 +838,9 @@ WindowPtr pWin;
int which; int which;
{ {
ShapeEventPtr *pHead, pShapeEvent; ShapeEventPtr *pHead, pShapeEvent;
ClientPtr client;
xShapeNotifyEvent se; xShapeNotifyEvent se;
BoxRec extents; BoxRec extents;
RegionPtr region; RegionPtr region;
BYTE shaped; BYTE shaped;
pHead = (ShapeEventPtr *) LookupIDByType(pWin->drawable.id, EventType); pHead = (ShapeEventPtr *) LookupIDByType(pWin->drawable.id, EventType);
@ -899,20 +893,16 @@ int which;
return; return;
} }
for (pShapeEvent = *pHead; pShapeEvent; pShapeEvent = pShapeEvent->next) { for (pShapeEvent = *pHead; pShapeEvent; pShapeEvent = pShapeEvent->next) {
client = pShapeEvent->client;
if (client == serverClient || client->clientGone)
continue;
se.type = ShapeNotify + ShapeEventBase; se.type = ShapeNotify + ShapeEventBase;
se.kind = which; se.kind = which;
se.window = pWin->drawable.id; se.window = pWin->drawable.id;
se.sequenceNumber = client->sequence;
se.x = extents.x1; se.x = extents.x1;
se.y = extents.y1; se.y = extents.y1;
se.width = extents.x2 - extents.x1; se.width = extents.x2 - extents.x1;
se.height = extents.y2 - extents.y1; se.height = extents.y2 - extents.y1;
se.time = currentTime.milliseconds; se.time = currentTime.milliseconds;
se.shaped = shaped; se.shaped = shaped;
WriteEventsToClient(client, 1, (xEvent *) &se); WriteEventsToClient(pShapeEvent->client, 1, (xEvent *) &se);
} }
} }

View File

@ -638,7 +638,6 @@ ClientPtr client;
ev.type = ShmCompletionCode; ev.type = ShmCompletionCode;
ev.drawable = stuff->drawable; ev.drawable = stuff->drawable;
ev.sequenceNumber = client->sequence;
ev.minorEvent = X_ShmPutImage; ev.minorEvent = X_ShmPutImage;
ev.majorEvent = ShmReqCode; ev.majorEvent = ShmReqCode;
ev.shmseg = stuff->shmseg; ev.shmseg = stuff->shmseg;

View File

@ -547,7 +547,6 @@ SyncAlarm *pAlarm;
ane.type = SyncEventBase + XSyncAlarmNotify; ane.type = SyncEventBase + XSyncAlarmNotify;
ane.kind = XSyncAlarmNotify; ane.kind = XSyncAlarmNotify;
ane.sequenceNumber = pAlarm->client->sequence;
ane.alarm = pAlarm->alarm_id; ane.alarm = pAlarm->alarm_id;
if (pTrigger->pCounter) { if (pTrigger->pCounter) {
ane.counter_value_hi = XSyncValueHigh32(pTrigger->pCounter->value); ane.counter_value_hi = XSyncValueHigh32(pTrigger->pCounter->value);
@ -569,7 +568,6 @@ SyncAlarm *pAlarm;
/* send to other interested clients */ /* send to other interested clients */
for (pcl = pAlarm->pEventClients; pcl; pcl = pcl->next) { for (pcl = pAlarm->pEventClients; pcl; pcl = pcl->next) {
if (!pAlarm->client->clientGone) { if (!pAlarm->client->clientGone) {
ane.sequenceNumber = pcl->client->sequence;
WriteEventsToClient(pcl->client, 1, (xEvent *) &ane); WriteEventsToClient(pcl->client, 1, (xEvent *) &ane);
} }
} }
@ -602,7 +600,6 @@ int num_events;
pev->type = SyncEventBase + XSyncCounterNotify; pev->type = SyncEventBase + XSyncCounterNotify;
pev->kind = XSyncCounterNotify; pev->kind = XSyncCounterNotify;
pev->sequenceNumber = client->sequence;
pev->counter = pTrigger->pCounter->id; pev->counter = pTrigger->pCounter->id;
pev->wait_value_lo = XSyncValueLow32(pTrigger->test_value); pev->wait_value_lo = XSyncValueLow32(pTrigger->test_value);
pev->wait_value_hi = XSyncValueHigh32(pTrigger->test_value); pev->wait_value_hi = XSyncValueHigh32(pTrigger->test_value);

View File

@ -3809,7 +3809,6 @@ SendErrorToClient(ClientPtr client, unsigned majorCode, unsigned minorCode,
xError rep; xError rep;
rep.type = X_Error; rep.type = X_Error;
rep.sequenceNumber = client->sequence;
rep.errorCode = errorCode; rep.errorCode = errorCode;
rep.majorCode = majorCode; rep.majorCode = majorCode;
rep.minorCode = minorCode; rep.minorCode = minorCode;

View File

@ -1038,8 +1038,6 @@ _X_EXPORT int
TryClientEvents(ClientPtr client, xEvent *pEvents, int count, Mask mask, TryClientEvents(ClientPtr client, xEvent *pEvents, int count, Mask mask,
Mask filter, GrabPtr grab) Mask filter, GrabPtr grab)
{ {
int i;
int type; int type;
#ifdef DEBUG #ifdef DEBUG
@ -1070,12 +1068,6 @@ TryClientEvents(ClientPtr client, xEvent *pEvents, int count, Mask mask,
pEvents->u.u.detail = NotifyNormal; pEvents->u.u.detail = NotifyNormal;
} }
} }
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 (BitIsOn(criticalEvents, type)) {
#ifdef SMART_SCHEDULE #ifdef SMART_SCHEDULE
@ -3414,6 +3406,9 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events)
if (!pClient || pClient == serverClient || pClient->clientGone) if (!pClient || pClient == serverClient || pClient->clientGone)
return; return;
for (i = 0; i < count; i++)
if ((events[i].u.u.type & 0x7f) != KeymapNotify)
events[i].u.u.sequenceNumber = pClient->sequence;
if (EventCallback) { if (EventCallback) {
EventInfoRec eventinfo; EventInfoRec eventinfo;

View File

@ -221,7 +221,6 @@ RRDeliverCrtcEvent(ClientPtr client, WindowPtr pWin, RRCrtcPtr crtc)
ce.type = RRNotify + RREventBase; ce.type = RRNotify + RREventBase;
ce.subCode = RRNotify_CrtcChange; ce.subCode = RRNotify_CrtcChange;
ce.sequenceNumber = client->sequence;
ce.timestamp = pScrPriv->lastSetTime.milliseconds; ce.timestamp = pScrPriv->lastSetTime.milliseconds;
ce.window = pWin->drawable.id; ce.window = pWin->drawable.id;
ce.crtc = crtc->id; ce.crtc = crtc->id;

View File

@ -269,7 +269,6 @@ RRDeliverOutputEvent(ClientPtr client, WindowPtr pWin, RROutputPtr output)
oe.type = RRNotify + RREventBase; oe.type = RRNotify + RREventBase;
oe.subCode = RRNotify_OutputChange; oe.subCode = RRNotify_OutputChange;
oe.sequenceNumber = client->sequence;
oe.timestamp = pScrPriv->lastSetTime.milliseconds; oe.timestamp = pScrPriv->lastSetTime.milliseconds;
oe.configTimestamp = pScrPriv->lastConfigTime.milliseconds; oe.configTimestamp = pScrPriv->lastConfigTime.milliseconds;
oe.window = pWin->drawable.id; oe.window = pWin->drawable.id;

View File

@ -114,13 +114,11 @@ RRDeliverScreenEvent(ClientPtr client, WindowPtr pWin, ScreenPtr pScreen)
se.type = RRScreenChangeNotify + RREventBase; se.type = RRScreenChangeNotify + RREventBase;
se.rotation = (CARD8) (crtc ? crtc->rotation : RR_Rotate_0); se.rotation = (CARD8) (crtc ? crtc->rotation : RR_Rotate_0);
se.timestamp = pScrPriv->lastSetTime.milliseconds; se.timestamp = pScrPriv->lastSetTime.milliseconds;
se.sequenceNumber = client->sequence;
se.configTimestamp = pScrPriv->lastConfigTime.milliseconds; se.configTimestamp = pScrPriv->lastConfigTime.milliseconds;
se.root = pRoot->drawable.id; se.root = pRoot->drawable.id;
se.window = pWin->drawable.id; se.window = pWin->drawable.id;
se.subpixelOrder = PictureGetSubpixelOrder(pScreen); se.subpixelOrder = PictureGetSubpixelOrder(pScreen);
se.sequenceNumber = client->sequence;
if (mode) { if (mode) {
se.sizeID = -1; se.sizeID = -1;
for (i = 0; i < output->numModes; i++) for (i = 0; i < output->numModes; i++)

View File

@ -153,7 +153,6 @@ CursorDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor)
ev.type = XFixesEventBase + XFixesCursorNotify; ev.type = XFixesEventBase + XFixesCursorNotify;
ev.subtype = XFixesDisplayCursorNotify; ev.subtype = XFixesDisplayCursorNotify;
ev.sequenceNumber = e->pClient->sequence;
ev.window = e->pWindow->drawable.id; ev.window = e->pWindow->drawable.id;
ev.cursorSerial = pCursor->serialNumber; ev.cursorSerial = pCursor->serialNumber;
ev.timestamp = currentTime.milliseconds; ev.timestamp = currentTime.milliseconds;

View File

@ -81,7 +81,6 @@ XFixesSelectionCallback(CallbackListPtr *callbacks, pointer data, pointer args)
ev.type = XFixesEventBase + XFixesSelectionNotify; ev.type = XFixesEventBase + XFixesSelectionNotify;
ev.subtype = subtype; ev.subtype = subtype;
ev.sequenceNumber = e->pClient->sequence;
ev.window = e->pWindow->drawable.id; ev.window = e->pWindow->drawable.id;
if (subtype == XFixesSetSelectionOwnerNotify) if (subtype == XFixesSetSelectionOwnerNotify)
ev.owner = selection->window; ev.owner = selection->window;