aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xi/xiproperty.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-07-11 11:55:48 +0200
committermarha <marha@users.sourceforge.net>2012-07-11 11:55:48 +0200
commit6cab6b3ebc8ed1a81ced93d621ea3abf05e282ab (patch)
tree21e1af7ee94600e349ae21353dc11963a06e988d /xorg-server/Xi/xiproperty.c
parent75f57cf199b6c042b0f7515e3a1ab80f7ccecfab (diff)
parentd137057fd13e83ec15ab416c7fe774741da06047 (diff)
downloadvcxsrv-6cab6b3ebc8ed1a81ced93d621ea3abf05e282ab.tar.gz
vcxsrv-6cab6b3ebc8ed1a81ced93d621ea3abf05e282ab.tar.bz2
vcxsrv-6cab6b3ebc8ed1a81ced93d621ea3abf05e282ab.zip
Merge remote-tracking branch 'origin/released'
Conflicts: xorg-server/Xext/shm.c xorg-server/Xext/sync.c xorg-server/Xext/xf86bigfont.c xorg-server/Xi/opendev.c xorg-server/dix/dispatch.c xorg-server/include/globals.h xorg-server/mi/miinitext.c
Diffstat (limited to 'xorg-server/Xi/xiproperty.c')
-rw-r--r--xorg-server/Xi/xiproperty.c47
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);
}