diff options
Diffstat (limited to 'xorg-server/Xi/xiproperty.c')
-rw-r--r-- | xorg-server/Xi/xiproperty.c | 100 |
1 files changed, 48 insertions, 52 deletions
diff --git a/xorg-server/Xi/xiproperty.c b/xorg-server/Xi/xiproperty.c index ca731042c..86429c1d9 100644 --- a/xorg-server/Xi/xiproperty.c +++ b/xorg-server/Xi/xiproperty.c @@ -183,23 +183,23 @@ static void send_property_event(DeviceIntPtr dev, Atom property, int what) { 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 - }; + xXIPropertyEvent xi2; devicePropertyNotify event; + event.type = DevicePropertyNotify; + event.deviceid = dev->id; + event.state = state; + event.atom = property; + event.time = currentTime.milliseconds; + + + 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, DevicePropertyNotifyMask, (xEvent *) &event, 1); @@ -861,13 +861,12 @@ ProcXListDeviceProperties(ClientPtr client) if (rc != Success) return rc; - rep = (xListDevicePropertiesReply) { - .repType = X_Reply, - .RepType = X_ListDeviceProperties, - .sequenceNumber = client->sequence, - .length = natoms, - .nAtoms = natoms - }; + + rep.repType = X_Reply; + rep.RepType = X_ListDeviceProperties; + rep.sequenceNumber = client->sequence; + rep.length = natoms; + rep.nAtoms = natoms; WriteReplyToClient(client, sizeof(xListDevicePropertiesReply), &rep); if (natoms) { @@ -957,17 +956,16 @@ ProcXGetDeviceProperty(ClientPtr client) if (rc != Success) return rc; - reply = (xGetDevicePropertyReply) { - .repType = X_Reply, - .RepType = X_GetDeviceProperty, - .sequenceNumber = client->sequence, - .length = bytes_to_int32(length), - .propertyType = type, - .bytesAfter = bytes_after, - .nItems = nitems, - .format = format, - .deviceid = dev->id - }; + + reply.repType = X_Reply; + reply.RepType = X_GetDeviceProperty; + reply.sequenceNumber = client->sequence; + reply.length = bytes_to_int32(length); + reply.propertyType = type; + reply.bytesAfter = bytes_after; + reply.nItems = nitems; + reply.format = format; + reply.deviceid = dev->id; if (stuff->delete && (reply.bytesAfter == 0)) send_property_event(dev, stuff->property, XIPropertyDeleted); @@ -1101,13 +1099,12 @@ ProcXIListProperties(ClientPtr client) if (rc != Success) return rc; - rep = (xXIListPropertiesReply) { - .repType = X_Reply, - .RepType = X_XIListProperties, - .sequenceNumber = client->sequence, - .length = natoms, - .num_properties = natoms - }; + + rep.repType = X_Reply; + rep.RepType = X_XIListProperties; + rep.sequenceNumber = client->sequence; + rep.length = natoms; + rep.num_properties = natoms; WriteReplyToClient(client, sizeof(xXIListPropertiesReply), &rep); if (natoms) { @@ -1197,16 +1194,15 @@ ProcXIGetProperty(ClientPtr client) if (rc != Success) return rc; - reply = (xXIGetPropertyReply) { - .repType = X_Reply, - .RepType = X_XIGetProperty, - .sequenceNumber = client->sequence, - .length = bytes_to_int32(length), - .type = type, - .bytes_after = bytes_after, - .num_items = nitems, - .format = format - }; + + reply.repType = X_Reply; + reply.RepType = X_XIGetProperty; + reply.sequenceNumber = client->sequence; + reply.length = bytes_to_int32(length); + reply.type = type; + reply.bytes_after = bytes_after; + reply.num_items = nitems; + reply.format = format; if (length && stuff->delete && (reply.bytes_after == 0)) send_property_event(dev, stuff->property, XIPropertyDeleted); |