mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-09 23:22:22 +00:00
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 changed files with 321 additions and 319 deletions
13
Xi/chgdctl.c
13
Xi/chgdctl.c
|
|
@ -113,7 +113,6 @@ ProcXChangeDeviceControl(ClientPtr client)
|
|||
AxisInfoPtr a;
|
||||
CARD32 *resolution;
|
||||
xDeviceEnableCtl *e;
|
||||
devicePresenceNotify dpn;
|
||||
|
||||
REQUEST(xChangeDeviceControlReq);
|
||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
|
||||
|
|
@ -211,11 +210,13 @@ ProcXChangeDeviceControl(ClientPtr client)
|
|||
|
||||
out:
|
||||
if (ret == Success) {
|
||||
dpn.type = DevicePresenceNotify;
|
||||
dpn.time = currentTime.milliseconds;
|
||||
dpn.devchange = DeviceControlChanged;
|
||||
dpn.deviceid = dev->id;
|
||||
dpn.control = stuff->control;
|
||||
devicePresenceNotify dpn = {
|
||||
.type = DevicePresenceNotify,
|
||||
.time = currentTime.milliseconds,
|
||||
.devchange = DeviceControlChanged,
|
||||
.deviceid = dev->id,
|
||||
.control = stuff->control
|
||||
};
|
||||
SendEventToAllWindows(dev, DevicePresenceNotifyMask,
|
||||
(xEvent *) &dpn, 1);
|
||||
|
||||
|
|
|
|||
|
|
@ -137,13 +137,14 @@ ProcXGrabDeviceButton(ClientPtr client)
|
|||
X_GrabDeviceButton)) != Success)
|
||||
return ret;
|
||||
|
||||
memset(¶m, 0, sizeof(param));
|
||||
param.grabtype = XI;
|
||||
param.ownerEvents = stuff->ownerEvents;
|
||||
param.this_device_mode = stuff->this_device_mode;
|
||||
param.other_devices_mode = stuff->other_devices_mode;
|
||||
param.grabWindow = stuff->grabWindow;
|
||||
param.modifiers = stuff->modifiers;
|
||||
param = (GrabParameters) {
|
||||
.grabtype = XI,
|
||||
.ownerEvents = stuff->ownerEvents,
|
||||
.this_device_mode = stuff->this_device_mode,
|
||||
.other_devices_mode = stuff->other_devices_mode,
|
||||
.grabWindow = stuff->grabWindow,
|
||||
.modifiers = stuff->modifiers
|
||||
};
|
||||
mask.xi = tmp[stuff->grabbed_device].mask;
|
||||
|
||||
ret = GrabButton(client, dev, mdev, stuff->button, ¶m, XI, &mask);
|
||||
|
|
|
|||
|
|
@ -135,13 +135,14 @@ ProcXGrabDeviceKey(ClientPtr client)
|
|||
X_GrabDeviceKey)) != Success)
|
||||
return ret;
|
||||
|
||||
memset(¶m, 0, sizeof(param));
|
||||
param.grabtype = XI;
|
||||
param.ownerEvents = stuff->ownerEvents;
|
||||
param.this_device_mode = stuff->this_device_mode;
|
||||
param.other_devices_mode = stuff->other_devices_mode;
|
||||
param.grabWindow = stuff->grabWindow;
|
||||
param.modifiers = stuff->modifiers;
|
||||
param = (GrabParameters) {
|
||||
.grabtype = XI,
|
||||
.ownerEvents = stuff->ownerEvents,
|
||||
.this_device_mode = stuff->this_device_mode,
|
||||
.other_devices_mode = stuff->other_devices_mode,
|
||||
.grabWindow = stuff->grabWindow,
|
||||
.modifiers = stuff->modifiers
|
||||
};
|
||||
mask.xi = tmp[stuff->grabbed_device].mask;
|
||||
|
||||
ret = GrabKey(client, dev, mdev, stuff->key, ¶m, XI, &mask);
|
||||
|
|
|
|||
|
|
@ -182,30 +182,27 @@ static long XIPropHandlerID = 1;
|
|||
static void
|
||||
send_property_event(DeviceIntPtr dev, Atom property, int what)
|
||||
{
|
||||
devicePropertyNotify event;
|
||||
xXIPropertyEvent xi2;
|
||||
int state;
|
||||
int state = (what == XIPropertyDeleted) ? PropertyDelete : PropertyNewValue;
|
||||
devicePropertyNotify event = {
|
||||
.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);
|
||||
|
||||
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),
|
||||
(xEvent *) &xi2, 1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue