Use C99 designated initializers in extension Events
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
This commit is contained in:
parent
0af79b124e
commit
9805cedf7b
23
Xext/saver.c
23
Xext/saver.c
|
@ -406,7 +406,6 @@ SendScreenSaverNotify(ScreenPtr pScreen, int state, Bool forced)
|
||||||
ScreenSaverScreenPrivatePtr pPriv;
|
ScreenSaverScreenPrivatePtr pPriv;
|
||||||
ScreenSaverEventPtr pEv;
|
ScreenSaverEventPtr pEv;
|
||||||
unsigned long mask;
|
unsigned long mask;
|
||||||
xScreenSaverNotifyEvent ev;
|
|
||||||
int kind;
|
int kind;
|
||||||
|
|
||||||
UpdateCurrentTimeIf();
|
UpdateCurrentTimeIf();
|
||||||
|
@ -424,16 +423,18 @@ SendScreenSaverNotify(ScreenPtr pScreen, int state, Bool forced)
|
||||||
else
|
else
|
||||||
kind = ScreenSaverInternal;
|
kind = ScreenSaverInternal;
|
||||||
for (pEv = pPriv->events; pEv; pEv = pEv->next) {
|
for (pEv = pPriv->events; pEv; pEv = pEv->next) {
|
||||||
if (!(pEv->mask & mask))
|
if (pEv->mask & mask) {
|
||||||
continue;
|
xScreenSaverNotifyEvent ev = {
|
||||||
ev.type = ScreenSaverNotify + ScreenSaverEventBase;
|
.type = ScreenSaverNotify + ScreenSaverEventBase,
|
||||||
ev.state = state;
|
.state = state,
|
||||||
ev.timestamp = currentTime.milliseconds;
|
.timestamp = currentTime.milliseconds,
|
||||||
ev.root = pScreen->root->drawable.id;
|
.root = pScreen->root->drawable.id,
|
||||||
ev.window = pScreen->screensaver.wid;
|
.window = pScreen->screensaver.wid,
|
||||||
ev.kind = kind;
|
.kind = kind,
|
||||||
ev.forced = forced;
|
.forced = forced
|
||||||
WriteEventsToClient(pEv->client, 1, (xEvent *) &ev);
|
};
|
||||||
|
WriteEventsToClient(pEv->client, 1, (xEvent *) &ev);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -192,10 +192,10 @@ SecurityDeleteAuthorization(pointer value, XID id)
|
||||||
|
|
||||||
while ((pEventClient = pAuth->eventClients)) {
|
while ((pEventClient = pAuth->eventClients)) {
|
||||||
/* send revocation event event */
|
/* send revocation event event */
|
||||||
xSecurityAuthorizationRevokedEvent are;
|
xSecurityAuthorizationRevokedEvent are = {
|
||||||
|
.type = SecurityEventBase + XSecurityAuthorizationRevoked,
|
||||||
are.type = SecurityEventBase + XSecurityAuthorizationRevoked;
|
.authId = pAuth->id
|
||||||
are.authId = pAuth->id;
|
};
|
||||||
WriteEventsToClient(rClient(pEventClient), 1, (xEvent *) &are);
|
WriteEventsToClient(rClient(pEventClient), 1, (xEvent *) &are);
|
||||||
FreeResource(pEventClient->resource, RT_NONE);
|
FreeResource(pEventClient->resource, RT_NONE);
|
||||||
}
|
}
|
||||||
|
|
21
Xext/shape.c
21
Xext/shape.c
|
@ -826,7 +826,6 @@ void
|
||||||
SendShapeNotify(WindowPtr pWin, int which)
|
SendShapeNotify(WindowPtr pWin, int which)
|
||||||
{
|
{
|
||||||
ShapeEventPtr *pHead, pShapeEvent;
|
ShapeEventPtr *pHead, pShapeEvent;
|
||||||
xShapeNotifyEvent se;
|
|
||||||
BoxRec extents;
|
BoxRec extents;
|
||||||
RegionPtr region;
|
RegionPtr region;
|
||||||
BYTE shaped;
|
BYTE shaped;
|
||||||
|
@ -883,15 +882,17 @@ SendShapeNotify(WindowPtr pWin, int which)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (pShapeEvent = *pHead; pShapeEvent; pShapeEvent = pShapeEvent->next) {
|
for (pShapeEvent = *pHead; pShapeEvent; pShapeEvent = pShapeEvent->next) {
|
||||||
se.type = ShapeNotify + ShapeEventBase;
|
xShapeNotifyEvent se = {
|
||||||
se.kind = which;
|
.type = ShapeNotify + ShapeEventBase,
|
||||||
se.window = pWin->drawable.id;
|
.kind = which,
|
||||||
se.x = extents.x1;
|
.window = pWin->drawable.id,
|
||||||
se.y = extents.y1;
|
.x = extents.x1,
|
||||||
se.width = extents.x2 - extents.x1;
|
.y = extents.y1,
|
||||||
se.height = extents.y2 - extents.y1;
|
.width = extents.x2 - extents.x1,
|
||||||
se.time = currentTime.milliseconds;
|
.height = extents.y2 - extents.y1,
|
||||||
se.shaped = shaped;
|
.time = currentTime.milliseconds,
|
||||||
|
.shaped = shaped
|
||||||
|
};
|
||||||
WriteEventsToClient(pShapeEvent->client, 1, (xEvent *) &se);
|
WriteEventsToClient(pShapeEvent->client, 1, (xEvent *) &se);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
16
Xext/shm.c
16
Xext/shm.c
|
@ -595,14 +595,14 @@ ProcShmPutImage(ClientPtr client)
|
||||||
stuff->dstX, stuff->dstY, shmdesc->addr + stuff->offset);
|
stuff->dstX, stuff->dstY, shmdesc->addr + stuff->offset);
|
||||||
|
|
||||||
if (stuff->sendEvent) {
|
if (stuff->sendEvent) {
|
||||||
xShmCompletionEvent ev;
|
xShmCompletionEvent ev = {
|
||||||
|
.type = ShmCompletionCode,
|
||||||
ev.type = ShmCompletionCode;
|
.drawable = stuff->drawable,
|
||||||
ev.drawable = stuff->drawable;
|
.minorEvent = X_ShmPutImage,
|
||||||
ev.minorEvent = X_ShmPutImage;
|
.majorEvent = ShmReqCode,
|
||||||
ev.majorEvent = ShmReqCode;
|
.shmseg = stuff->shmseg,
|
||||||
ev.shmseg = stuff->shmseg;
|
.offset = stuff->offset
|
||||||
ev.offset = stuff->offset;
|
};
|
||||||
WriteEventsToClient(client, 1, (xEvent *) &ev);
|
WriteEventsToClient(client, 1, (xEvent *) &ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
18
Xext/sync.c
18
Xext/sync.c
|
@ -437,9 +437,16 @@ SyncSendAlarmNotifyEvents(SyncAlarm * pAlarm)
|
||||||
|
|
||||||
UpdateCurrentTime();
|
UpdateCurrentTime();
|
||||||
|
|
||||||
ane.type = SyncEventBase + XSyncAlarmNotify;
|
ane = (xSyncAlarmNotifyEvent) {
|
||||||
ane.kind = XSyncAlarmNotify;
|
.type = SyncEventBase + XSyncAlarmNotify,
|
||||||
ane.alarm = pAlarm->alarm_id;
|
.kind = XSyncAlarmNotify,
|
||||||
|
.alarm = pAlarm->alarm_id,
|
||||||
|
.alarm_value_hi = XSyncValueHigh32(pTrigger->test_value),
|
||||||
|
.alarm_value_lo = XSyncValueLow32(pTrigger->test_value),
|
||||||
|
.time = currentTime.milliseconds,
|
||||||
|
.state = pAlarm->state
|
||||||
|
};
|
||||||
|
|
||||||
if (pTrigger->pSync && SYNC_COUNTER == pTrigger->pSync->type) {
|
if (pTrigger->pSync && SYNC_COUNTER == pTrigger->pSync->type) {
|
||||||
ane.counter_value_hi = XSyncValueHigh32(pCounter->value);
|
ane.counter_value_hi = XSyncValueHigh32(pCounter->value);
|
||||||
ane.counter_value_lo = XSyncValueLow32(pCounter->value);
|
ane.counter_value_lo = XSyncValueLow32(pCounter->value);
|
||||||
|
@ -449,11 +456,6 @@ SyncSendAlarmNotifyEvents(SyncAlarm * pAlarm)
|
||||||
ane.counter_value_hi = ane.counter_value_lo = 0;
|
ane.counter_value_hi = ane.counter_value_lo = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ane.alarm_value_hi = XSyncValueHigh32(pTrigger->test_value);
|
|
||||||
ane.alarm_value_lo = XSyncValueLow32(pTrigger->test_value);
|
|
||||||
ane.time = currentTime.milliseconds;
|
|
||||||
ane.state = pAlarm->state;
|
|
||||||
|
|
||||||
/* send to owner */
|
/* send to owner */
|
||||||
if (pAlarm->events)
|
if (pAlarm->events)
|
||||||
WriteEventsToClient(pAlarm->client, 1, (xEvent *) &ane);
|
WriteEventsToClient(pAlarm->client, 1, (xEvent *) &ane);
|
||||||
|
|
|
@ -1029,14 +1029,14 @@ ProcXvShmPutImage(ClientPtr client)
|
||||||
stuff->send_event, stuff->width, stuff->height);
|
stuff->send_event, stuff->width, stuff->height);
|
||||||
|
|
||||||
if ((status == Success) && stuff->send_event) {
|
if ((status == Success) && stuff->send_event) {
|
||||||
xShmCompletionEvent ev;
|
xShmCompletionEvent ev = {
|
||||||
|
.type = ShmCompletionCode,
|
||||||
ev.type = ShmCompletionCode;
|
.drawable = stuff->drawable,
|
||||||
ev.drawable = stuff->drawable;
|
.minorEvent = xv_ShmPutImage,
|
||||||
ev.minorEvent = xv_ShmPutImage;
|
.majorEvent = XvReqCode,
|
||||||
ev.majorEvent = XvReqCode;
|
.shmseg = stuff->shmseg,
|
||||||
ev.shmseg = stuff->shmseg;
|
.offset = stuff->offset
|
||||||
ev.offset = stuff->offset;
|
};
|
||||||
WriteEventsToClient(client, 1, (xEvent *) &ev);
|
WriteEventsToClient(client, 1, (xEvent *) &ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -507,19 +507,20 @@ XvdiDestroyEncoding(pointer value, XID id)
|
||||||
static int
|
static int
|
||||||
XvdiSendVideoNotify(XvPortPtr pPort, DrawablePtr pDraw, int reason)
|
XvdiSendVideoNotify(XvPortPtr pPort, DrawablePtr pDraw, int reason)
|
||||||
{
|
{
|
||||||
xvEvent event;
|
|
||||||
XvVideoNotifyPtr pn;
|
XvVideoNotifyPtr pn;
|
||||||
|
|
||||||
dixLookupResourceByType((pointer *) &pn, pDraw->id, XvRTVideoNotifyList,
|
dixLookupResourceByType((pointer *) &pn, pDraw->id, XvRTVideoNotifyList,
|
||||||
serverClient, DixReadAccess);
|
serverClient, DixReadAccess);
|
||||||
|
|
||||||
while (pn) {
|
while (pn) {
|
||||||
|
xvEvent event = {
|
||||||
|
.u.videoNotify.reason = reason,
|
||||||
|
.u.videoNotify.time = currentTime.milliseconds,
|
||||||
|
.u.videoNotify.drawable = pDraw->id,
|
||||||
|
.u.videoNotify.port = pPort->id
|
||||||
|
};
|
||||||
event.u.u.type = XvEventBase + XvVideoNotify;
|
event.u.u.type = XvEventBase + XvVideoNotify;
|
||||||
event.u.videoNotify.time = currentTime.milliseconds;
|
WriteEventsToClient(pn->client, 1, (xEventPtr) &event);
|
||||||
event.u.videoNotify.drawable = pDraw->id;
|
|
||||||
event.u.videoNotify.port = pPort->id;
|
|
||||||
event.u.videoNotify.reason = reason;
|
|
||||||
WriteEventsToClient(pn->client, 1, (xEventPtr) & event);
|
|
||||||
pn = pn->next;
|
pn = pn->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -530,18 +531,19 @@ XvdiSendVideoNotify(XvPortPtr pPort, DrawablePtr pDraw, int reason)
|
||||||
int
|
int
|
||||||
XvdiSendPortNotify(XvPortPtr pPort, Atom attribute, INT32 value)
|
XvdiSendPortNotify(XvPortPtr pPort, Atom attribute, INT32 value)
|
||||||
{
|
{
|
||||||
xvEvent event;
|
|
||||||
XvPortNotifyPtr pn;
|
XvPortNotifyPtr pn;
|
||||||
|
|
||||||
pn = pPort->pNotify;
|
pn = pPort->pNotify;
|
||||||
|
|
||||||
while (pn) {
|
while (pn) {
|
||||||
|
xvEvent event = {
|
||||||
|
.u.portNotify.time = currentTime.milliseconds,
|
||||||
|
.u.portNotify.port = pPort->id,
|
||||||
|
.u.portNotify.attribute = attribute,
|
||||||
|
.u.portNotify.value = value
|
||||||
|
};
|
||||||
event.u.u.type = XvEventBase + XvPortNotify;
|
event.u.u.type = XvEventBase + XvPortNotify;
|
||||||
event.u.portNotify.time = currentTime.milliseconds;
|
WriteEventsToClient(pn->client, 1, (xEventPtr) &event);
|
||||||
event.u.portNotify.port = pPort->id;
|
|
||||||
event.u.portNotify.attribute = attribute;
|
|
||||||
event.u.portNotify.value = value;
|
|
||||||
WriteEventsToClient(pn->client, 1, (xEventPtr) & event);
|
|
||||||
pn = pn->next;
|
pn = pn->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
13
Xi/chgdctl.c
13
Xi/chgdctl.c
|
@ -113,7 +113,6 @@ ProcXChangeDeviceControl(ClientPtr client)
|
||||||
AxisInfoPtr a;
|
AxisInfoPtr a;
|
||||||
CARD32 *resolution;
|
CARD32 *resolution;
|
||||||
xDeviceEnableCtl *e;
|
xDeviceEnableCtl *e;
|
||||||
devicePresenceNotify dpn;
|
|
||||||
|
|
||||||
REQUEST(xChangeDeviceControlReq);
|
REQUEST(xChangeDeviceControlReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
|
REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
|
||||||
|
@ -211,11 +210,13 @@ ProcXChangeDeviceControl(ClientPtr client)
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (ret == Success) {
|
if (ret == Success) {
|
||||||
dpn.type = DevicePresenceNotify;
|
devicePresenceNotify dpn = {
|
||||||
dpn.time = currentTime.milliseconds;
|
.type = DevicePresenceNotify,
|
||||||
dpn.devchange = DeviceControlChanged;
|
.time = currentTime.milliseconds,
|
||||||
dpn.deviceid = dev->id;
|
.devchange = DeviceControlChanged,
|
||||||
dpn.control = stuff->control;
|
.deviceid = dev->id,
|
||||||
|
.control = stuff->control
|
||||||
|
};
|
||||||
SendEventToAllWindows(dev, DevicePresenceNotifyMask,
|
SendEventToAllWindows(dev, DevicePresenceNotifyMask,
|
||||||
(xEvent *) &dpn, 1);
|
(xEvent *) &dpn, 1);
|
||||||
|
|
||||||
|
|
|
@ -137,13 +137,14 @@ ProcXGrabDeviceButton(ClientPtr client)
|
||||||
X_GrabDeviceButton)) != Success)
|
X_GrabDeviceButton)) != Success)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
memset(¶m, 0, sizeof(param));
|
param = (GrabParameters) {
|
||||||
param.grabtype = XI;
|
.grabtype = XI,
|
||||||
param.ownerEvents = stuff->ownerEvents;
|
.ownerEvents = stuff->ownerEvents,
|
||||||
param.this_device_mode = stuff->this_device_mode;
|
.this_device_mode = stuff->this_device_mode,
|
||||||
param.other_devices_mode = stuff->other_devices_mode;
|
.other_devices_mode = stuff->other_devices_mode,
|
||||||
param.grabWindow = stuff->grabWindow;
|
.grabWindow = stuff->grabWindow,
|
||||||
param.modifiers = stuff->modifiers;
|
.modifiers = stuff->modifiers
|
||||||
|
};
|
||||||
mask.xi = tmp[stuff->grabbed_device].mask;
|
mask.xi = tmp[stuff->grabbed_device].mask;
|
||||||
|
|
||||||
ret = GrabButton(client, dev, mdev, stuff->button, ¶m, XI, &mask);
|
ret = GrabButton(client, dev, mdev, stuff->button, ¶m, XI, &mask);
|
||||||
|
|
|
@ -135,13 +135,14 @@ ProcXGrabDeviceKey(ClientPtr client)
|
||||||
X_GrabDeviceKey)) != Success)
|
X_GrabDeviceKey)) != Success)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
memset(¶m, 0, sizeof(param));
|
param = (GrabParameters) {
|
||||||
param.grabtype = XI;
|
.grabtype = XI,
|
||||||
param.ownerEvents = stuff->ownerEvents;
|
.ownerEvents = stuff->ownerEvents,
|
||||||
param.this_device_mode = stuff->this_device_mode;
|
.this_device_mode = stuff->this_device_mode,
|
||||||
param.other_devices_mode = stuff->other_devices_mode;
|
.other_devices_mode = stuff->other_devices_mode,
|
||||||
param.grabWindow = stuff->grabWindow;
|
.grabWindow = stuff->grabWindow,
|
||||||
param.modifiers = stuff->modifiers;
|
.modifiers = stuff->modifiers
|
||||||
|
};
|
||||||
mask.xi = tmp[stuff->grabbed_device].mask;
|
mask.xi = tmp[stuff->grabbed_device].mask;
|
||||||
|
|
||||||
ret = GrabKey(client, dev, mdev, stuff->key, ¶m, XI, &mask);
|
ret = GrabKey(client, dev, mdev, stuff->key, ¶m, XI, &mask);
|
||||||
|
|
|
@ -182,30 +182,27 @@ static long XIPropHandlerID = 1;
|
||||||
static void
|
static void
|
||||||
send_property_event(DeviceIntPtr dev, Atom property, int what)
|
send_property_event(DeviceIntPtr dev, Atom property, int what)
|
||||||
{
|
{
|
||||||
devicePropertyNotify event;
|
int state = (what == XIPropertyDeleted) ? PropertyDelete : PropertyNewValue;
|
||||||
xXIPropertyEvent xi2;
|
devicePropertyNotify event = {
|
||||||
int state;
|
.type = DevicePropertyNotify,
|
||||||
|
.deviceid = dev->id,
|
||||||
|
.state = state,
|
||||||
|
.atom = property,
|
||||||
|
.time = currentTime.milliseconds
|
||||||
|
};
|
||||||
|
xXIPropertyEvent xi2 = {
|
||||||
|
.type = GenericEvent,
|
||||||
|
.extension = IReqCode,
|
||||||
|
.length = 0,
|
||||||
|
.evtype = XI_PropertyEvent,
|
||||||
|
.deviceid = dev->id,
|
||||||
|
.time = currentTime.milliseconds,
|
||||||
|
.property = property,
|
||||||
|
.what = what
|
||||||
|
};
|
||||||
|
|
||||||
if (what == XIPropertyDeleted)
|
|
||||||
state = PropertyDelete;
|
|
||||||
else
|
|
||||||
state = PropertyNewValue;
|
|
||||||
|
|
||||||
event.type = DevicePropertyNotify;
|
|
||||||
event.deviceid = dev->id;
|
|
||||||
event.state = state;
|
|
||||||
event.atom = property;
|
|
||||||
event.time = currentTime.milliseconds;
|
|
||||||
SendEventToAllWindows(dev, DevicePropertyNotifyMask, (xEvent *) &event, 1);
|
SendEventToAllWindows(dev, DevicePropertyNotifyMask, (xEvent *) &event, 1);
|
||||||
|
|
||||||
xi2.type = GenericEvent;
|
|
||||||
xi2.extension = IReqCode;
|
|
||||||
xi2.length = 0;
|
|
||||||
xi2.evtype = XI_PropertyEvent;
|
|
||||||
xi2.deviceid = dev->id;
|
|
||||||
xi2.time = currentTime.milliseconds;
|
|
||||||
xi2.property = property;
|
|
||||||
xi2.what = what;
|
|
||||||
SendEventToAllWindows(dev, GetEventFilter(dev, (xEvent *) &xi2),
|
SendEventToAllWindows(dev, GetEventFilter(dev, (xEvent *) &xi2),
|
||||||
(xEvent *) &xi2, 1);
|
(xEvent *) &xi2, 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,15 +46,17 @@ DamageExtNotify(DamageExtPtr pDamageExt, BoxPtr pBoxes, int nBoxes)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
UpdateCurrentTimeIf();
|
UpdateCurrentTimeIf();
|
||||||
ev.type = DamageEventBase + XDamageNotify;
|
ev = (xDamageNotifyEvent) {
|
||||||
ev.level = pDamageExt->level;
|
.type = DamageEventBase + XDamageNotify,
|
||||||
ev.drawable = pDamageExt->drawable;
|
.level = pDamageExt->level,
|
||||||
ev.damage = pDamageExt->id;
|
.drawable = pDamageExt->drawable,
|
||||||
ev.timestamp = currentTime.milliseconds;
|
.damage = pDamageExt->id,
|
||||||
ev.geometry.x = pDrawable->x;
|
.timestamp = currentTime.milliseconds,
|
||||||
ev.geometry.y = pDrawable->y;
|
.geometry.x = pDrawable->x,
|
||||||
ev.geometry.width = pDrawable->width;
|
.geometry.y = pDrawable->y,
|
||||||
ev.geometry.height = pDrawable->height;
|
.geometry.width = pDrawable->width,
|
||||||
|
.geometry.height = pDrawable->height
|
||||||
|
};
|
||||||
if (pBoxes) {
|
if (pBoxes) {
|
||||||
for (i = 0; i < nBoxes; i++) {
|
for (i = 0; i < nBoxes; i++) {
|
||||||
ev.level = pDamageExt->level;
|
ev.level = pDamageExt->level;
|
||||||
|
|
|
@ -178,12 +178,13 @@ __glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust,
|
||||||
CARD64 msc, CARD32 sbc)
|
CARD64 msc, CARD32 sbc)
|
||||||
{
|
{
|
||||||
__GLXdrawable *drawable = data;
|
__GLXdrawable *drawable = data;
|
||||||
xGLXBufferSwapComplete2 wire;
|
xGLXBufferSwapComplete2 wire = {
|
||||||
|
.type = __glXEventBase + GLX_BufferSwapComplete
|
||||||
|
};
|
||||||
|
|
||||||
if (!(drawable->eventMask & GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK))
|
if (!(drawable->eventMask & GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wire.type = __glXEventBase + GLX_BufferSwapComplete;
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case DRI2_EXCHANGE_COMPLETE:
|
case DRI2_EXCHANGE_COMPLETE:
|
||||||
wire.event_type = GLX_EXCHANGE_COMPLETE_INTEL;
|
wire.event_type = GLX_EXCHANGE_COMPLETE_INTEL;
|
||||||
|
|
|
@ -900,15 +900,16 @@ DGAStealKeyEvent(DeviceIntPtr dev, int index, int key_code, int is_down)
|
||||||
if (!pScreenPriv || !pScreenPriv->grabKeyboard) /* no direct mode */
|
if (!pScreenPriv || !pScreenPriv->grabKeyboard) /* no direct mode */
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
memset(&event, 0, sizeof(event));
|
event = (DGAEvent) {
|
||||||
event.header = ET_Internal;
|
.header = ET_Internal,
|
||||||
event.type = ET_DGAEvent;
|
.type = ET_DGAEvent,
|
||||||
event.length = sizeof(event);
|
.length = sizeof(event),
|
||||||
event.time = GetTimeInMillis();
|
.time = GetTimeInMillis(),
|
||||||
event.subtype = (is_down ? ET_KeyPress : ET_KeyRelease);
|
.subtype = (is_down ? ET_KeyPress : ET_KeyRelease),
|
||||||
event.detail = key_code;
|
.detail = key_code,
|
||||||
event.dx = 0;
|
.dx = 0,
|
||||||
event.dy = 0;
|
.dy = 0
|
||||||
|
};
|
||||||
mieqEnqueue(dev, (InternalEvent *) &event);
|
mieqEnqueue(dev, (InternalEvent *) &event);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -928,15 +929,16 @@ DGAStealMotionEvent(DeviceIntPtr dev, int index, int dx, int dy)
|
||||||
if (!pScreenPriv || !pScreenPriv->grabMouse) /* no direct mode */
|
if (!pScreenPriv || !pScreenPriv->grabMouse) /* no direct mode */
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
memset(&event, 0, sizeof(event));
|
event = (DGAEvent) {
|
||||||
event.header = ET_Internal;
|
.header = ET_Internal,
|
||||||
event.type = ET_DGAEvent;
|
.type = ET_DGAEvent,
|
||||||
event.length = sizeof(event);
|
.length = sizeof(event),
|
||||||
event.time = GetTimeInMillis();
|
.time = GetTimeInMillis(),
|
||||||
event.subtype = ET_Motion;
|
.subtype = ET_Motion,
|
||||||
event.detail = 0;
|
.detail = 0,
|
||||||
event.dx = dx;
|
.dx = dx,
|
||||||
event.dy = dy;
|
.dy = dy
|
||||||
|
};
|
||||||
mieqEnqueue(dev, (InternalEvent *) &event);
|
mieqEnqueue(dev, (InternalEvent *) &event);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -955,15 +957,16 @@ DGAStealButtonEvent(DeviceIntPtr dev, int index, int button, int is_down)
|
||||||
if (!pScreenPriv || !pScreenPriv->grabMouse)
|
if (!pScreenPriv || !pScreenPriv->grabMouse)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
memset(&event, 0, sizeof(event));
|
event = (DGAEvent) {
|
||||||
event.header = ET_Internal;
|
.header = ET_Internal,
|
||||||
event.type = ET_DGAEvent;
|
.type = ET_DGAEvent,
|
||||||
event.length = sizeof(event);
|
.length = sizeof(event),
|
||||||
event.time = GetTimeInMillis();
|
.time = GetTimeInMillis(),
|
||||||
event.subtype = (is_down ? ET_ButtonPress : ET_ButtonRelease);
|
.subtype = (is_down ? ET_ButtonPress : ET_ButtonRelease),
|
||||||
event.detail = button;
|
.detail = button,
|
||||||
event.dx = 0;
|
.dx = 0,
|
||||||
event.dy = 0;
|
.dy = 0
|
||||||
|
};
|
||||||
mieqEnqueue(dev, (InternalEvent *) &event);
|
mieqEnqueue(dev, (InternalEvent *) &event);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -988,16 +991,15 @@ DGAProcessKeyboardEvent(ScreenPtr pScreen, DGAEvent * event, DeviceIntPtr keybd)
|
||||||
KeyClassPtr keyc = keybd->key;
|
KeyClassPtr keyc = keybd->key;
|
||||||
DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
|
DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
|
||||||
DeviceIntPtr pointer = GetMaster(keybd, POINTER_OR_FLOAT);
|
DeviceIntPtr pointer = GetMaster(keybd, POINTER_OR_FLOAT);
|
||||||
DeviceEvent ev;
|
DeviceEvent ev = {
|
||||||
|
.header = ET_Internal,
|
||||||
memset(&ev, 0, sizeof(ev));
|
.length = sizeof(ev),
|
||||||
ev.header = ET_Internal;
|
.detail.key = event->detail,
|
||||||
ev.length = sizeof(ev);
|
.type = event->subtype,
|
||||||
ev.detail.key = event->detail;
|
.root_x = 0,
|
||||||
ev.type = event->subtype;
|
.root_y = 0,
|
||||||
ev.root_x = 0;
|
.corestate = XkbStateFieldFromRec(&keyc->xkbInfo->state)
|
||||||
ev.root_y = 0;
|
};
|
||||||
ev.corestate = XkbStateFieldFromRec(&keyc->xkbInfo->state);
|
|
||||||
ev.corestate |= pointer->button->state;
|
ev.corestate |= pointer->button->state;
|
||||||
|
|
||||||
UpdateDeviceState(keybd, &ev);
|
UpdateDeviceState(keybd, &ev);
|
||||||
|
@ -1006,15 +1008,15 @@ DGAProcessKeyboardEvent(ScreenPtr pScreen, DGAEvent * event, DeviceIntPtr keybd)
|
||||||
* Deliver the DGA event
|
* Deliver the DGA event
|
||||||
*/
|
*/
|
||||||
if (pScreenPriv->client) {
|
if (pScreenPriv->client) {
|
||||||
dgaEvent de;
|
dgaEvent de = {
|
||||||
|
.u.event.time = event->time,
|
||||||
|
.u.event.dx = event->dx,
|
||||||
|
.u.event.dy = event->dy,
|
||||||
|
.u.event.screen = pScreen->myNum,
|
||||||
|
.u.event.state = ev.corestate
|
||||||
|
};
|
||||||
de.u.u.type = *XDGAEventBase + GetCoreType(ev.type);
|
de.u.u.type = *XDGAEventBase + GetCoreType(ev.type);
|
||||||
de.u.u.detail = event->detail;
|
de.u.u.detail = event->detail;
|
||||||
de.u.event.time = event->time;
|
|
||||||
de.u.event.dx = event->dx;
|
|
||||||
de.u.event.dy = event->dy;
|
|
||||||
de.u.event.screen = pScreen->myNum;
|
|
||||||
de.u.event.state = ev.corestate;
|
|
||||||
|
|
||||||
/* If the DGA client has selected input, then deliver based on the usual filter */
|
/* If the DGA client has selected input, then deliver based on the usual filter */
|
||||||
TryClientEvents(pScreenPriv->client, keybd, (xEvent *) &de, 1,
|
TryClientEvents(pScreenPriv->client, keybd, (xEvent *) &de, 1,
|
||||||
|
@ -1039,14 +1041,14 @@ DGAProcessPointerEvent(ScreenPtr pScreen, DGAEvent * event, DeviceIntPtr mouse)
|
||||||
{
|
{
|
||||||
ButtonClassPtr butc = mouse->button;
|
ButtonClassPtr butc = mouse->button;
|
||||||
DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
|
DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
|
||||||
DeviceEvent ev;
|
|
||||||
DeviceIntPtr master = GetMaster(mouse, MASTER_KEYBOARD);
|
DeviceIntPtr master = GetMaster(mouse, MASTER_KEYBOARD);
|
||||||
|
DeviceEvent ev = {
|
||||||
|
.header = ET_Internal,
|
||||||
|
.length = sizeof(ev),
|
||||||
|
.type = event->subtype,
|
||||||
|
.corestate = butc ? butc->state : 0
|
||||||
|
};
|
||||||
|
|
||||||
memset(&ev, 0, sizeof(ev));
|
|
||||||
ev.header = ET_Internal;
|
|
||||||
ev.length = sizeof(ev);
|
|
||||||
ev.type = event->subtype;
|
|
||||||
ev.corestate = butc ? butc->state : 0;
|
|
||||||
if (master && master->key)
|
if (master && master->key)
|
||||||
ev.corestate |= XkbStateFieldFromRec(&master->key->xkbInfo->state);
|
ev.corestate |= XkbStateFieldFromRec(&master->key->xkbInfo->state);
|
||||||
|
|
||||||
|
@ -1056,18 +1058,16 @@ DGAProcessPointerEvent(ScreenPtr pScreen, DGAEvent * event, DeviceIntPtr mouse)
|
||||||
* Deliver the DGA event
|
* Deliver the DGA event
|
||||||
*/
|
*/
|
||||||
if (pScreenPriv->client) {
|
if (pScreenPriv->client) {
|
||||||
dgaEvent de;
|
int coreEquiv = GetCoreType(ev.type);
|
||||||
int coreEquiv;
|
dgaEvent de = {
|
||||||
|
.u.event.time = event->time,
|
||||||
coreEquiv = GetCoreType(ev.type);
|
.u.event.dx = event->dx,
|
||||||
|
.u.event.dy = event->dy,
|
||||||
|
.u.event.screen = pScreen->myNum,
|
||||||
|
.u.event.state = ev.corestate
|
||||||
|
};
|
||||||
de.u.u.type = *XDGAEventBase + coreEquiv;
|
de.u.u.type = *XDGAEventBase + coreEquiv;
|
||||||
de.u.u.detail = event->detail;
|
de.u.u.detail = event->detail;
|
||||||
de.u.event.time = event->time;
|
|
||||||
de.u.event.dx = event->dx;
|
|
||||||
de.u.event.dy = event->dy;
|
|
||||||
de.u.event.screen = pScreen->myNum;
|
|
||||||
de.u.event.state = ev.corestate;
|
|
||||||
|
|
||||||
/* If the DGA client has selected input, then deliver based on the usual filter */
|
/* If the DGA client has selected input, then deliver based on the usual filter */
|
||||||
TryClientEvents(pScreenPriv->client, mouse, (xEvent *) &de, 1,
|
TryClientEvents(pScreenPriv->client, mouse, (xEvent *) &de, 1,
|
||||||
|
|
|
@ -240,7 +240,6 @@ static void
|
||||||
SendXF86VidModeNotify(ScreenPtr pScreen, int state, Bool forced)
|
SendXF86VidModeNotify(ScreenPtr pScreen, int state, Bool forced)
|
||||||
{
|
{
|
||||||
XF86VidModeScreenPrivatePtr pPriv;
|
XF86VidModeScreenPrivatePtr pPriv;
|
||||||
XF86VidModeEventPtr pEv;
|
|
||||||
unsigned long mask;
|
unsigned long mask;
|
||||||
xXF86VidModeNotifyEvent ev;
|
xXF86VidModeNotifyEvent ev;
|
||||||
int kind;
|
int kind;
|
||||||
|
@ -253,15 +252,17 @@ SendXF86VidModeNotify(ScreenPtr pScreen, int state, Bool forced)
|
||||||
return;
|
return;
|
||||||
kind = XF86VidModeModeChange;
|
kind = XF86VidModeModeChange;
|
||||||
for (pEv = pPriv->events; pEv; pEv = pEv->next) {
|
for (pEv = pPriv->events; pEv; pEv = pEv->next) {
|
||||||
if (!(pEv->mask & mask))
|
if (pEv->mask & mask) {
|
||||||
continue;
|
XF86VidModeEventPtr pEv = {
|
||||||
ev.type = XF86VidModeNotify + XF86VidModeEventBase;
|
.type = XF86VidModeNotify + XF86VidModeEventBase,
|
||||||
ev.state = state;
|
.state = state,
|
||||||
ev.timestamp = currentTime.milliseconds;
|
.timestamp = currentTime.milliseconds,
|
||||||
ev.root = pScreen->root->drawable.id;
|
.root = pScreen->root->drawable.id,
|
||||||
ev.kind = kind;
|
.kind = kind,
|
||||||
ev.forced = forced;
|
.forced = forced
|
||||||
WriteEventsToClient(pEv->client, 1, (xEvent *) &ev);
|
};
|
||||||
|
WriteEventsToClient(pEv->client, 1, (xEvent *) &ev);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -161,11 +161,11 @@ ProcDRI2Authenticate(ClientPtr client)
|
||||||
static void
|
static void
|
||||||
DRI2InvalidateBuffersEvent(DrawablePtr pDraw, void *priv, XID id)
|
DRI2InvalidateBuffersEvent(DrawablePtr pDraw, void *priv, XID id)
|
||||||
{
|
{
|
||||||
xDRI2InvalidateBuffers event;
|
|
||||||
ClientPtr client = priv;
|
ClientPtr client = priv;
|
||||||
|
xDRI2InvalidateBuffers event = {
|
||||||
event.type = DRI2EventBase + DRI2_InvalidateBuffers;
|
.type = DRI2EventBase + DRI2_InvalidateBuffers,
|
||||||
event.drawable = id;
|
.drawable = id
|
||||||
|
};
|
||||||
|
|
||||||
WriteEventsToClient(client, 1, (xEvent *) &event);
|
WriteEventsToClient(client, 1, (xEvent *) &event);
|
||||||
}
|
}
|
||||||
|
@ -363,17 +363,17 @@ static void
|
||||||
DRI2SwapEvent(ClientPtr client, void *data, int type, CARD64 ust, CARD64 msc,
|
DRI2SwapEvent(ClientPtr client, void *data, int type, CARD64 ust, CARD64 msc,
|
||||||
CARD32 sbc)
|
CARD32 sbc)
|
||||||
{
|
{
|
||||||
xDRI2BufferSwapComplete2 event;
|
|
||||||
DrawablePtr pDrawable = data;
|
DrawablePtr pDrawable = data;
|
||||||
|
xDRI2BufferSwapComplete2 event = {
|
||||||
event.type = DRI2EventBase + DRI2_BufferSwapComplete;
|
.type = DRI2EventBase + DRI2_BufferSwapComplete,
|
||||||
event.event_type = type;
|
.event_type = type,
|
||||||
event.drawable = pDrawable->id;
|
.drawable = pDrawable->id,
|
||||||
event.ust_hi = (CARD64) ust >> 32;
|
.ust_hi = (CARD64) ust >> 32,
|
||||||
event.ust_lo = ust & 0xffffffff;
|
.ust_lo = ust & 0xffffffff,
|
||||||
event.msc_hi = (CARD64) msc >> 32;
|
.msc_hi = (CARD64) msc >> 32,
|
||||||
event.msc_lo = msc & 0xffffffff;
|
.msc_lo = msc & 0xffffffff,
|
||||||
event.sbc = sbc;
|
.sbc = sbc
|
||||||
|
};
|
||||||
|
|
||||||
WriteEventsToClient(client, 1, (xEvent *) &event);
|
WriteEventsToClient(client, 1, (xEvent *) &event);
|
||||||
}
|
}
|
||||||
|
|
|
@ -236,29 +236,21 @@ RRDeliverCrtcEvent(ClientPtr client, WindowPtr pWin, RRCrtcPtr crtc)
|
||||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
ScreenPtr pScreen = pWin->drawable.pScreen;
|
||||||
|
|
||||||
rrScrPriv(pScreen);
|
rrScrPriv(pScreen);
|
||||||
xRRCrtcChangeNotifyEvent ce;
|
|
||||||
RRModePtr mode = crtc->mode;
|
RRModePtr mode = crtc->mode;
|
||||||
|
|
||||||
ce.type = RRNotify + RREventBase;
|
xRRCrtcChangeNotifyEvent ce = {
|
||||||
ce.subCode = RRNotify_CrtcChange;
|
.type = RRNotify + RREventBase,
|
||||||
ce.timestamp = pScrPriv->lastSetTime.milliseconds;
|
.subCode = RRNotify_CrtcChange,
|
||||||
ce.window = pWin->drawable.id;
|
.timestamp = pScrPriv->lastSetTime.milliseconds,
|
||||||
ce.crtc = crtc->id;
|
.window = pWin->drawable.id,
|
||||||
ce.rotation = crtc->rotation;
|
.crtc = crtc->id,
|
||||||
if (mode) {
|
.mode = mode ? mode->mode.id : None,
|
||||||
ce.mode = mode->mode.id;
|
.rotation = crtc->rotation,
|
||||||
ce.x = crtc->x;
|
.x = mode ? crtc->x : 0,
|
||||||
ce.y = crtc->y;
|
.y = mode ? crtc->y : 0,
|
||||||
ce.width = mode->mode.width;
|
.width = mode ? mode->mode.width : 0,
|
||||||
ce.height = mode->mode.height;
|
.height = mode ? mode->mode.height : 0
|
||||||
}
|
};
|
||||||
else {
|
|
||||||
ce.mode = None;
|
|
||||||
ce.x = 0;
|
|
||||||
ce.y = 0;
|
|
||||||
ce.width = 0;
|
|
||||||
ce.height = 0;
|
|
||||||
}
|
|
||||||
WriteEventsToClient(client, 1, (xEvent *) &ce);
|
WriteEventsToClient(client, 1, (xEvent *) &ce);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -305,28 +305,22 @@ RRDeliverOutputEvent(ClientPtr client, WindowPtr pWin, RROutputPtr output)
|
||||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
ScreenPtr pScreen = pWin->drawable.pScreen;
|
||||||
|
|
||||||
rrScrPriv(pScreen);
|
rrScrPriv(pScreen);
|
||||||
xRROutputChangeNotifyEvent oe;
|
|
||||||
RRCrtcPtr crtc = output->crtc;
|
RRCrtcPtr crtc = output->crtc;
|
||||||
RRModePtr mode = crtc ? crtc->mode : 0;
|
RRModePtr mode = crtc ? crtc->mode : NULL;
|
||||||
|
|
||||||
oe.type = RRNotify + RREventBase;
|
xRROutputChangeNotifyEvent oe = {
|
||||||
oe.subCode = RRNotify_OutputChange;
|
.type = RRNotify + RREventBase,
|
||||||
oe.timestamp = pScrPriv->lastSetTime.milliseconds;
|
.subCode = RRNotify_OutputChange,
|
||||||
oe.configTimestamp = pScrPriv->lastConfigTime.milliseconds;
|
.timestamp = pScrPriv->lastSetTime.milliseconds,
|
||||||
oe.window = pWin->drawable.id;
|
.configTimestamp = pScrPriv->lastConfigTime.milliseconds,
|
||||||
oe.output = output->id;
|
.window = pWin->drawable.id,
|
||||||
if (crtc) {
|
.output = output->id,
|
||||||
oe.crtc = crtc->id;
|
.crtc = crtc ? crtc->id : None,
|
||||||
oe.mode = mode ? mode->mode.id : None;
|
.mode = mode ? mode->mode.id : None,
|
||||||
oe.rotation = crtc->rotation;
|
.rotation = crtc ? crtc->rotation : RR_Rotate_0,
|
||||||
}
|
.connection = output->connection,
|
||||||
else {
|
.subpixelOrder = output->subpixelOrder
|
||||||
oe.crtc = None;
|
};
|
||||||
oe.mode = None;
|
|
||||||
oe.rotation = RR_Rotate_0;
|
|
||||||
}
|
|
||||||
oe.connection = output->connection;
|
|
||||||
oe.subpixelOrder = output->subpixelOrder;
|
|
||||||
WriteEventsToClient(client, 1, (xEvent *) &oe);
|
WriteEventsToClient(client, 1, (xEvent *) &oe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,14 +65,14 @@ RRDestroyOutputProperty(RRPropertyPtr prop)
|
||||||
static void
|
static void
|
||||||
RRDeleteProperty(RROutputRec * output, RRPropertyRec * prop)
|
RRDeleteProperty(RROutputRec * output, RRPropertyRec * prop)
|
||||||
{
|
{
|
||||||
xRROutputPropertyNotifyEvent event;
|
xRROutputPropertyNotifyEvent event = {
|
||||||
|
.type = RREventBase + RRNotify,
|
||||||
event.type = RREventBase + RRNotify;
|
.subCode = RRNotify_OutputProperty,
|
||||||
event.subCode = RRNotify_OutputProperty;
|
.output = output->id,
|
||||||
event.output = output->id;
|
.state = PropertyDelete,
|
||||||
event.state = PropertyDelete;
|
.atom = prop->propertyName,
|
||||||
event.atom = prop->propertyName;
|
.timestamp = currentTime.milliseconds
|
||||||
event.timestamp = currentTime.milliseconds;
|
};
|
||||||
|
|
||||||
RRDeliverPropertyEvent(output->pScreen, (xEvent *) &event);
|
RRDeliverPropertyEvent(output->pScreen, (xEvent *) &event);
|
||||||
|
|
||||||
|
@ -138,7 +138,6 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type,
|
||||||
pointer value, Bool sendevent, Bool pending)
|
pointer value, Bool sendevent, Bool pending)
|
||||||
{
|
{
|
||||||
RRPropertyPtr prop;
|
RRPropertyPtr prop;
|
||||||
xRROutputPropertyNotifyEvent event;
|
|
||||||
rrScrPrivPtr pScrPriv = rrGetScrPriv(output->pScreen);
|
rrScrPrivPtr pScrPriv = rrGetScrPriv(output->pScreen);
|
||||||
int size_in_bytes;
|
int size_in_bytes;
|
||||||
int total_size;
|
int total_size;
|
||||||
|
@ -237,12 +236,14 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type,
|
||||||
output->pendingProperties = TRUE;
|
output->pendingProperties = TRUE;
|
||||||
|
|
||||||
if (sendevent) {
|
if (sendevent) {
|
||||||
event.type = RREventBase + RRNotify;
|
xRROutputPropertyNotifyEvent event = {
|
||||||
event.subCode = RRNotify_OutputProperty;
|
.type = RREventBase + RRNotify,
|
||||||
event.output = output->id;
|
.subCode = RRNotify_OutputProperty,
|
||||||
event.state = PropertyNewValue;
|
.output = output->id,
|
||||||
event.atom = prop->propertyName;
|
.state = PropertyNewValue,
|
||||||
event.timestamp = currentTime.milliseconds;
|
.atom = prop->propertyName,
|
||||||
|
.timestamp = currentTime.milliseconds
|
||||||
|
};
|
||||||
RRDeliverPropertyEvent(output->pScreen, (xEvent *) &event);
|
RRDeliverPropertyEvent(output->pScreen, (xEvent *) &event);
|
||||||
}
|
}
|
||||||
return Success;
|
return Success;
|
||||||
|
@ -682,14 +683,14 @@ ProcRRGetOutputProperty(ClientPtr client)
|
||||||
reply.propertyType = prop_value->type;
|
reply.propertyType = prop_value->type;
|
||||||
|
|
||||||
if (stuff->delete && (reply.bytesAfter == 0)) {
|
if (stuff->delete && (reply.bytesAfter == 0)) {
|
||||||
xRROutputPropertyNotifyEvent event;
|
xRROutputPropertyNotifyEvent event = {
|
||||||
|
.type = RREventBase + RRNotify,
|
||||||
event.type = RREventBase + RRNotify;
|
.subCode = RRNotify_OutputProperty,
|
||||||
event.subCode = RRNotify_OutputProperty;
|
.output = output->id,
|
||||||
event.output = output->id;
|
.state = PropertyDelete,
|
||||||
event.state = PropertyDelete;
|
.atom = prop->propertyName,
|
||||||
event.atom = prop->propertyName;
|
.timestamp = currentTime.milliseconds
|
||||||
event.timestamp = currentTime.milliseconds;
|
};
|
||||||
RRDeliverPropertyEvent(output->pScreen, (xEvent *) &event);
|
RRDeliverPropertyEvent(output->pScreen, (xEvent *) &event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,20 +71,20 @@ void
|
||||||
RRSendConfigNotify(ScreenPtr pScreen)
|
RRSendConfigNotify(ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
WindowPtr pWin = pScreen->root;
|
WindowPtr pWin = pScreen->root;
|
||||||
xEvent event;
|
xEvent event = {
|
||||||
|
.u.configureNotify.window = pWin->drawable.id,
|
||||||
event.u.u.type = ConfigureNotify;
|
.u.configureNotify.aboveSibling = None,
|
||||||
event.u.configureNotify.window = pWin->drawable.id;
|
.u.configureNotify.x = 0,
|
||||||
event.u.configureNotify.aboveSibling = None;
|
.u.configureNotify.y = 0,
|
||||||
event.u.configureNotify.x = 0;
|
|
||||||
event.u.configureNotify.y = 0;
|
|
||||||
|
|
||||||
/* XXX xinerama stuff ? */
|
/* XXX xinerama stuff ? */
|
||||||
|
|
||||||
event.u.configureNotify.width = pWin->drawable.width;
|
.u.configureNotify.width = pWin->drawable.width,
|
||||||
event.u.configureNotify.height = pWin->drawable.height;
|
.u.configureNotify.height = pWin->drawable.height,
|
||||||
event.u.configureNotify.borderWidth = wBorderWidth(pWin);
|
.u.configureNotify.borderWidth = wBorderWidth(pWin),
|
||||||
event.u.configureNotify.override = pWin->overrideRedirect;
|
.u.configureNotify.override = pWin->overrideRedirect
|
||||||
|
};
|
||||||
|
event.u.u.type = ConfigureNotify;
|
||||||
DeliverEvents(pWin, &event, 1, NullWindow);
|
DeliverEvents(pWin, &event, 1, NullWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,19 +92,20 @@ void
|
||||||
RRDeliverScreenEvent(ClientPtr client, WindowPtr pWin, ScreenPtr pScreen)
|
RRDeliverScreenEvent(ClientPtr client, WindowPtr pWin, ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
rrScrPriv(pScreen);
|
rrScrPriv(pScreen);
|
||||||
xRRScreenChangeNotifyEvent se;
|
|
||||||
RRCrtcPtr crtc = pScrPriv->numCrtcs ? pScrPriv->crtcs[0] : NULL;
|
RRCrtcPtr crtc = pScrPriv->numCrtcs ? pScrPriv->crtcs[0] : NULL;
|
||||||
WindowPtr pRoot = pScreen->root;
|
WindowPtr pRoot = pScreen->root;
|
||||||
|
|
||||||
se.type = RRScreenChangeNotify + RREventBase;
|
xRRScreenChangeNotifyEvent se = {
|
||||||
se.rotation = (CARD8) (crtc ? crtc->rotation : RR_Rotate_0);
|
.type = RRScreenChangeNotify + RREventBase,
|
||||||
se.timestamp = pScrPriv->lastSetTime.milliseconds;
|
.rotation = (CARD8) (crtc ? crtc->rotation : RR_Rotate_0),
|
||||||
se.configTimestamp = pScrPriv->lastConfigTime.milliseconds;
|
.timestamp = pScrPriv->lastSetTime.milliseconds,
|
||||||
se.root = pRoot->drawable.id;
|
.configTimestamp = pScrPriv->lastConfigTime.milliseconds,
|
||||||
se.window = pWin->drawable.id;
|
.root = pRoot->drawable.id,
|
||||||
se.subpixelOrder = PictureGetSubpixelOrder(pScreen);
|
.window = pWin->drawable.id,
|
||||||
|
.subpixelOrder = PictureGetSubpixelOrder(pScreen),
|
||||||
|
|
||||||
se.sizeID = RR10CurrentSizeID(pScreen);
|
.sizeID = RR10CurrentSizeID(pScreen)
|
||||||
|
};
|
||||||
|
|
||||||
if (se.rotation & (RR_Rotate_90 | RR_Rotate_270)) {
|
if (se.rotation & (RR_Rotate_90 | RR_Rotate_270)) {
|
||||||
se.widthInPixels = pScreen->height;
|
se.widthInPixels = pScreen->height;
|
||||||
|
|
|
@ -172,14 +172,14 @@ CursorDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
|
||||||
CursorCurrent[pDev->id] = pCursor;
|
CursorCurrent[pDev->id] = pCursor;
|
||||||
for (e = cursorEvents; e; e = e->next) {
|
for (e = cursorEvents; e; e = e->next) {
|
||||||
if ((e->eventMask & XFixesDisplayCursorNotifyMask)) {
|
if ((e->eventMask & XFixesDisplayCursorNotifyMask)) {
|
||||||
xXFixesCursorNotifyEvent ev;
|
xXFixesCursorNotifyEvent ev = {
|
||||||
|
.type = XFixesEventBase + XFixesCursorNotify,
|
||||||
ev.type = XFixesEventBase + XFixesCursorNotify;
|
.subtype = XFixesDisplayCursorNotify,
|
||||||
ev.subtype = XFixesDisplayCursorNotify;
|
.window = e->pWindow->drawable.id,
|
||||||
ev.window = e->pWindow->drawable.id;
|
.cursorSerial = pCursor ? pCursor->serialNumber : 0,
|
||||||
ev.cursorSerial = pCursor ? pCursor->serialNumber : 0;
|
.timestamp = currentTime.milliseconds,
|
||||||
ev.timestamp = currentTime.milliseconds;
|
.name = pCursor ? pCursor->name : None
|
||||||
ev.name = pCursor ? pCursor->name : None;
|
};
|
||||||
WriteEventsToClient(e->pClient, 1, (xEvent *) &ev);
|
WriteEventsToClient(e->pClient, 1, (xEvent *) &ev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,19 +77,16 @@ XFixesSelectionCallback(CallbackListPtr *callbacks, pointer data, pointer args)
|
||||||
}
|
}
|
||||||
for (e = selectionEvents; e; e = e->next) {
|
for (e = selectionEvents; e; e = e->next) {
|
||||||
if (e->selection == selection->selection && (e->eventMask & eventMask)) {
|
if (e->selection == selection->selection && (e->eventMask & eventMask)) {
|
||||||
xXFixesSelectionNotifyEvent ev;
|
xXFixesSelectionNotifyEvent ev = {
|
||||||
|
.type = XFixesEventBase + XFixesSelectionNotify,
|
||||||
memset(&ev, 0, sizeof(xXFixesSelectionNotifyEvent));
|
.subtype = subtype,
|
||||||
ev.type = XFixesEventBase + XFixesSelectionNotify;
|
.window = e->pWindow->drawable.id,
|
||||||
ev.subtype = subtype;
|
.owner = (subtype == XFixesSetSelectionOwnerNotify) ?
|
||||||
ev.window = e->pWindow->drawable.id;
|
selection->window : 0,
|
||||||
if (subtype == XFixesSetSelectionOwnerNotify)
|
.selection = e->selection,
|
||||||
ev.owner = selection->window;
|
.timestamp = currentTime.milliseconds,
|
||||||
else
|
.selectionTimestamp = selection->lastTimeChanged.milliseconds
|
||||||
ev.owner = 0;
|
};
|
||||||
ev.selection = e->selection;
|
|
||||||
ev.timestamp = currentTime.milliseconds;
|
|
||||||
ev.selectionTimestamp = selection->lastTimeChanged.milliseconds;
|
|
||||||
WriteEventsToClient(e->pClient, 1, (xEvent *) &ev);
|
WriteEventsToClient(e->pClient, 1, (xEvent *) &ev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,8 +59,6 @@ XkbSendLegacyMapNotify(DeviceIntPtr kbd, CARD16 xkb_event, CARD16 changed,
|
||||||
int i;
|
int i;
|
||||||
int keymap_changed = 0;
|
int keymap_changed = 0;
|
||||||
int modmap_changed = 0;
|
int modmap_changed = 0;
|
||||||
xEvent core_mn;
|
|
||||||
deviceMappingNotify xi_mn;
|
|
||||||
CARD32 time = GetTimeInMillis();
|
CARD32 time = GetTimeInMillis();
|
||||||
|
|
||||||
if (xkb_event == XkbNewKeyboardNotify) {
|
if (xkb_event == XkbNewKeyboardNotify) {
|
||||||
|
@ -78,11 +76,6 @@ XkbSendLegacyMapNotify(DeviceIntPtr kbd, CARD16 xkb_event, CARD16 changed,
|
||||||
if (!keymap_changed && !modmap_changed)
|
if (!keymap_changed && !modmap_changed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
core_mn.u.u.type = MappingNotify;
|
|
||||||
xi_mn.type = DeviceMappingNotify;
|
|
||||||
xi_mn.deviceid = kbd->id;
|
|
||||||
xi_mn.time = time;
|
|
||||||
|
|
||||||
/* 0 is serverClient. */
|
/* 0 is serverClient. */
|
||||||
for (i = 1; i < currentMaxClients; i++) {
|
for (i = 1; i < currentMaxClients; i++) {
|
||||||
if (!clients[i] || clients[i]->clientState != ClientStateRunning)
|
if (!clients[i] || clients[i]->clientState != ClientStateRunning)
|
||||||
|
@ -106,6 +99,7 @@ XkbSendLegacyMapNotify(DeviceIntPtr kbd, CARD16 xkb_event, CARD16 changed,
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (keymap_changed) {
|
if (keymap_changed) {
|
||||||
|
xEvent core_mn = { .u.u.type = MappingNotify };
|
||||||
core_mn.u.mappingNotify.request = MappingKeyboard;
|
core_mn.u.mappingNotify.request = MappingKeyboard;
|
||||||
|
|
||||||
/* Clip the keycode range to what the client knows about, so it
|
/* Clip the keycode range to what the client knows about, so it
|
||||||
|
@ -123,9 +117,12 @@ XkbSendLegacyMapNotify(DeviceIntPtr kbd, CARD16 xkb_event, CARD16 changed,
|
||||||
WriteEventsToClient(clients[i], 1, &core_mn);
|
WriteEventsToClient(clients[i], 1, &core_mn);
|
||||||
}
|
}
|
||||||
if (modmap_changed) {
|
if (modmap_changed) {
|
||||||
core_mn.u.mappingNotify.request = MappingModifier;
|
xEvent core_mn = {
|
||||||
core_mn.u.mappingNotify.firstKeyCode = 0;
|
.u.mappingNotify.request = MappingModifier,
|
||||||
core_mn.u.mappingNotify.count = 0;
|
.u.mappingNotify.firstKeyCode = 0,
|
||||||
|
.u.mappingNotify.count = 0
|
||||||
|
};
|
||||||
|
core_mn.u.u.type = MappingNotify;
|
||||||
WriteEventsToClient(clients[i], 1, &core_mn);
|
WriteEventsToClient(clients[i], 1, &core_mn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -134,16 +131,26 @@ XkbSendLegacyMapNotify(DeviceIntPtr kbd, CARD16 xkb_event, CARD16 changed,
|
||||||
* here? Clients might be upset, but that seems better than the
|
* here? Clients might be upset, but that seems better than the
|
||||||
* alternative of stale keymaps. -ds */
|
* alternative of stale keymaps. -ds */
|
||||||
if (keymap_changed) {
|
if (keymap_changed) {
|
||||||
xi_mn.request = MappingKeyboard;
|
deviceMappingNotify xi_mn = {
|
||||||
xi_mn.firstKeyCode = first_key;
|
.type = DeviceMappingNotify,
|
||||||
xi_mn.count = num_keys;
|
.deviceid = kbd->id,
|
||||||
|
.request = MappingKeyboard,
|
||||||
|
.firstKeyCode = first_key,
|
||||||
|
.count = num_keys,
|
||||||
|
.time = time
|
||||||
|
};
|
||||||
SendEventToAllWindows(kbd, DeviceMappingNotifyMask, (xEvent *) &xi_mn,
|
SendEventToAllWindows(kbd, DeviceMappingNotifyMask, (xEvent *) &xi_mn,
|
||||||
1);
|
1);
|
||||||
}
|
}
|
||||||
if (modmap_changed) {
|
if (modmap_changed) {
|
||||||
xi_mn.request = MappingModifier;
|
deviceMappingNotify xi_mn = {
|
||||||
xi_mn.firstKeyCode = 0;
|
.type = DeviceMappingNotify,
|
||||||
xi_mn.count = 0;
|
.deviceid = kbd->id,
|
||||||
|
.request = MappingModifier,
|
||||||
|
.firstKeyCode = 0,
|
||||||
|
.count = 0,
|
||||||
|
.time = time
|
||||||
|
};
|
||||||
SendEventToAllWindows(kbd, DeviceMappingNotifyMask, (xEvent *) &xi_mn,
|
SendEventToAllWindows(kbd, DeviceMappingNotifyMask, (xEvent *) &xi_mn,
|
||||||
1);
|
1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue