[PATCH 03/42] Xi: split ProcessOtherEvent into ProcessDeviceEvent

Peter Hutterer peter.hutterer at who-t.net
Wed Dec 14 19:01:40 PST 2011


No functional changes.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 Xi/exevents.c |   46 +++++++++++++++++++++++++++++-----------------
 1 files changed, 29 insertions(+), 17 deletions(-)

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 45a289a..ad9c3d6 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -902,13 +902,12 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event)
     return DEFAULT;
 }
 
+
 /**
- * Main device event processing function.
- * Called from when processing the events from the event queue.
- *
+ * Process DeviceEvents and DeviceChangedEvents.
  */
-void
-ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
+static void
+ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device)
 {
     GrabPtr grab;
     Bool deactivateDeviceGrab = FALSE;
@@ -919,18 +918,6 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
     DeviceIntPtr mouse = NULL, kbd = NULL;
     DeviceEvent *event = &ev->device_event;
 
-    verify_internal_event(ev);
-
-    if (ev->any.type == ET_RawKeyPress ||
-        ev->any.type == ET_RawKeyRelease ||
-        ev->any.type == ET_RawButtonPress ||
-        ev->any.type == ET_RawButtonRelease ||
-        ev->any.type == ET_RawMotion)
-    {
-        DeliverRawEvent(&ev->raw_event, device);
-        return;
-    }
-
     if (IsPointerDevice(device))
     {
         kbd = GetMaster(device, KEYBOARD_OR_FLOAT);
@@ -1042,6 +1029,31 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
     event->detail.key = key;
 }
 
+/**
+ * Main device event processing function.
+ * Called from when processing the events from the event queue.
+ *
+ */
+void
+ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
+{
+    verify_internal_event(ev);
+
+    switch(ev->any.type)
+    {
+        case  ET_RawKeyPress:
+        case  ET_RawKeyRelease:
+        case  ET_RawButtonPress:
+        case  ET_RawButtonRelease:
+        case  ET_RawMotion:
+            DeliverRawEvent(&ev->raw_event, device);
+            break;
+        default:
+            ProcessDeviceEvent(ev, device);
+            break;
+    }
+}
+
 int
 InitProximityClassDeviceStruct(DeviceIntPtr dev)
 {
-- 
1.7.7.1



More information about the xorg-devel mailing list