summaryrefslogtreecommitdiff
path: root/Xi/xiproperty.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@redhat.com>2008-08-13 13:11:44 +0930
committerPeter Hutterer <peter.hutterer@redhat.com>2008-08-15 14:52:13 +0930
commitde1573172ad2c2e98c101727930a468213295783 (patch)
tree78500abb755fcd8ab507628d1e9305265ae8a284 /Xi/xiproperty.c
parent8b9ed7dec2954d4890ddcc7c874fc0832b16495a (diff)
Backport device properties to XI 1.5 instead of XI 2.0
Diffstat (limited to 'Xi/xiproperty.c')
-rw-r--r--Xi/xiproperty.c36
1 files changed, 12 insertions, 24 deletions
diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c
index b4ccfe653..ec1ed6c29 100644
--- a/Xi/xiproperty.c
+++ b/Xi/xiproperty.c
@@ -191,21 +191,18 @@ XIDeleteAllDeviceProperties (DeviceIntPtr device)
{
XIPropertyPtr prop, next;
XIPropertyHandlerPtr curr_handler, next_handler;
- devicePropertyNotifyEvent event;
+ devicePropertyNotify event;
for (prop = device->properties.properties; prop; prop = next)
{
next = prop->next;
- event.type = GenericEvent;
- event.extension = IReqCode;
- event.evtype = XI_DevicePropertyNotify;
- event.length = 0;
+ event.type = DevicePropertyNotify;
event.deviceid = device->id;
event.state = PropertyDelete;
event.atom = prop->propertyName;
event.time = currentTime.milliseconds;
- SendEventToAllWindows(device, XI_DevicePropertyNotifyMask,
+ SendEventToAllWindows(device, DevicePropertyNotifyMask,
(xEvent*)&event, 1);
XIDestroyDeviceProperty(prop);
@@ -226,7 +223,7 @@ int
XIDeleteDeviceProperty (DeviceIntPtr device, Atom property, Bool fromClient)
{
XIPropertyPtr prop, *prev;
- devicePropertyNotifyEvent event;
+ devicePropertyNotify event;
for (prev = &device->properties.properties; (prop = *prev); prev = &(prop->next))
if (prop->propertyName == property)
@@ -238,15 +235,12 @@ XIDeleteDeviceProperty (DeviceIntPtr device, Atom property, Bool fromClient)
if (prop)
{
*prev = prop->next;
- event.type = GenericEvent;
- event.extension = IReqCode;
- event.length = 0;
- event.evtype = XI_DevicePropertyNotify;
+ event.type = DevicePropertyNotify;
event.deviceid = device->id;
event.state = PropertyDelete;
event.atom = prop->propertyName;
event.time = currentTime.milliseconds;
- SendEventToAllWindows(device, XI_DevicePropertyNotifyMask,
+ SendEventToAllWindows(device, DevicePropertyNotifyMask,
(xEvent*)&event, 1);
XIDestroyDeviceProperty (prop);
}
@@ -261,7 +255,7 @@ XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type,
Bool fromClient)
{
XIPropertyPtr prop;
- devicePropertyNotifyEvent event;
+ devicePropertyNotify event;
int size_in_bytes;
int total_size;
unsigned long total_len;
@@ -379,15 +373,12 @@ XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type,
if (sendevent)
{
- event.type = GenericEvent;
- event.extension = IReqCode;
- event.length = 0;
- event.evtype = XI_DevicePropertyNotify;
+ event.type = DevicePropertyNotify;
event.deviceid = dev->id;
event.state = PropertyNewValue;
event.atom = prop->propertyName;
event.time = currentTime.milliseconds;
- SendEventToAllWindows(dev, XI_DevicePropertyNotifyMask,
+ SendEventToAllWindows(dev, DevicePropertyNotifyMask,
(xEvent*)&event, 1);
}
return(Success);
@@ -786,17 +777,14 @@ ProcXGetDeviceProperty (ClientPtr client)
if (stuff->delete && (reply.bytesAfter == 0))
{
- devicePropertyNotifyEvent event;
+ devicePropertyNotify event;
- event.type = GenericEvent;
- event.extension = IReqCode;
- event.length = 0;
- event.evtype = XI_DevicePropertyNotify;
+ event.type = DevicePropertyNotify;
event.deviceid = dev->id;
event.state = PropertyDelete;
event.atom = prop->propertyName;
event.time = currentTime.milliseconds;
- SendEventToAllWindows(dev, XI_DevicePropertyNotifyMask,
+ SendEventToAllWindows(dev, DevicePropertyNotifyMask,
(xEvent*)&event, 1);
}