[PATCH] xfree86: use SendDevicePresenceEvents instead of manual event handling.

Peter Hutterer peter.hutterer at who-t.net
Wed Sep 16 23:05:59 PDT 2009


Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 dix/devices.c                  |    2 +-
 hw/xfree86/common/xf86Xinput.c |    9 +--------
 include/input.h                |    1 +
 3 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/dix/devices.c b/dix/devices.c
index 76e962e..62574f2 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -246,7 +246,7 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart)
     return dev;
 }
 
-static void
+void
 SendDevicePresenceEvent(int deviceid, int type)
 {
     DeviceIntRec dummyDev;
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 3543811..df51400 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -1082,14 +1082,7 @@ xf86DisableDevice(DeviceIntPtr dev, Bool panic)
         DisableDevice(dev, TRUE);
     } else
     {
-        ev.type = DevicePresenceNotify;
-        ev.time = currentTime.milliseconds;
-        ev.devchange = DeviceUnrecoverable;
-        ev.deviceid = dev->id;
-        dummyDev.id = 0;
-        SendEventToAllWindows(&dummyDev, DevicePresenceNotifyMask,
-                (xEvent *) &ev, 1);
-
+        SendDevicePresenceEvent(dev->id, DeviceUnrecoverable);
         DeleteInputDeviceRequest(dev);
     }
 }
diff --git a/include/input.h b/include/input.h
index 7ab5e9d..0e5b0bf 100644
--- a/include/input.h
+++ b/include/input.h
@@ -503,6 +503,7 @@ extern int AllocXTestDevice(ClientPtr client,
                              DeviceIntPtr master_keybd);
 extern BOOL IsXTestDevice(DeviceIntPtr dev, DeviceIntPtr master);
 extern DeviceIntPtr GetXTestDevice(DeviceIntPtr master);
+extern void SendDevicePresenceEvent(int deviceid, int type);
 
 /* misc event helpers */
 extern Mask GetEventFilter(DeviceIntPtr dev, xEvent *event);
-- 
1.6.3.rc1.2.g0164.dirty


More information about the xorg-devel mailing list