diff options
Diffstat (limited to 'xorg-server/Xi/xiproperty.c')
-rw-r--r-- | xorg-server/Xi/xiproperty.c | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/xorg-server/Xi/xiproperty.c b/xorg-server/Xi/xiproperty.c index 5f46b5435..86429c1d9 100644 --- a/xorg-server/Xi/xiproperty.c +++ b/xorg-server/Xi/xiproperty.c @@ -182,21 +182,14 @@ static long XIPropHandlerID = 1; static void send_property_event(DeviceIntPtr dev, Atom property, int what) { - devicePropertyNotify event; - xXIPropertyEvent xi2; - int state; - - if (what == XIPropertyDeleted) - state = PropertyDelete; - else - state = PropertyNewValue; - + int state = (what == XIPropertyDeleted) ? PropertyDelete : PropertyNewValue; + xXIPropertyEvent xi2; devicePropertyNotify event; 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; @@ -206,6 +199,10 @@ send_property_event(DeviceIntPtr dev, Atom property, int what) xi2.time = currentTime.milliseconds; xi2.property = property; xi2.what = what; + + + SendEventToAllWindows(dev, DevicePropertyNotifyMask, (xEvent *) &event, 1); + SendEventToAllWindows(dev, GetEventFilter(dev, (xEvent *) &xi2), (xEvent *) &xi2, 1); } @@ -864,10 +861,11 @@ ProcXListDeviceProperties(ClientPtr client) if (rc != Success) return rc; + rep.repType = X_Reply; rep.RepType = X_ListDeviceProperties; - rep.length = natoms; rep.sequenceNumber = client->sequence; + rep.length = natoms; rep.nAtoms = natoms; WriteReplyToClient(client, sizeof(xListDevicePropertiesReply), &rep); @@ -958,15 +956,16 @@ ProcXGetDeviceProperty(ClientPtr client) if (rc != Success) return rc; + reply.repType = X_Reply; reply.RepType = X_GetDeviceProperty; reply.sequenceNumber = client->sequence; - reply.deviceid = dev->id; + reply.length = bytes_to_int32(length); + reply.propertyType = type; + reply.bytesAfter = bytes_after; reply.nItems = nitems; reply.format = format; - reply.bytesAfter = bytes_after; - reply.propertyType = type; - reply.length = bytes_to_int32(length); + reply.deviceid = dev->id; if (stuff->delete && (reply.bytesAfter == 0)) send_property_event(dev, stuff->property, XIPropertyDeleted); @@ -1063,7 +1062,7 @@ SRepXListDeviceProperties(ClientPtr client, int size, swapl(&rep->length); swaps(&rep->nAtoms); /* properties will be swapped later, see ProcXListDeviceProperties */ - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } void @@ -1076,7 +1075,7 @@ SRepXGetDeviceProperty(ClientPtr client, int size, swapl(&rep->bytesAfter); swapl(&rep->nItems); /* data will be swapped, see ProcXGetDeviceProperty */ - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } /* XI2 Request/reply handling */ @@ -1100,10 +1099,11 @@ ProcXIListProperties(ClientPtr client) if (rc != Success) return rc; + rep.repType = X_Reply; rep.RepType = X_XIListProperties; - rep.length = natoms; rep.sequenceNumber = client->sequence; + rep.length = natoms; rep.num_properties = natoms; WriteReplyToClient(client, sizeof(xXIListPropertiesReply), &rep); @@ -1194,14 +1194,15 @@ ProcXIGetProperty(ClientPtr client) if (rc != Success) return rc; + 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; - reply.bytes_after = bytes_after; - reply.type = type; - reply.length = bytes_to_int32(length); if (length && stuff->delete && (reply.bytes_after == 0)) send_property_event(dev, stuff->property, XIPropertyDeleted); @@ -1300,7 +1301,7 @@ SRepXIListProperties(ClientPtr client, int size, xXIListPropertiesReply * rep) swapl(&rep->length); swaps(&rep->num_properties); /* properties will be swapped later, see ProcXIListProperties */ - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } void @@ -1312,5 +1313,5 @@ SRepXIGetProperty(ClientPtr client, int size, xXIGetPropertyReply * rep) swapl(&rep->bytes_after); swapl(&rep->num_items); /* data will be swapped, see ProcXIGetProperty */ - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } |