[mutter/wip/barriers: 1/16] input-events: Handle touch events



commit 85c1058c94057b97e40409aed61ded1ec7fc6391
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Aug 2 19:06:06 2011 +0200

    input-events: Handle touch events
    
    TouchBegin/End/Update are now handled similarly to
    ButtonPress/Release/MotionNotify.

 src/core/input-events.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)
---
diff --git a/src/core/input-events.c b/src/core/input-events.c
index c24c78a..7ac7a76 100644
--- a/src/core/input-events.c
+++ b/src/core/input-events.c
@@ -86,6 +86,15 @@ meta_input_event_get_type (MetaDisplay *display,
         case XI_Leave:
           type = LeaveNotify;
           break;
+        case XI_TouchBegin:
+          type = ButtonPress;
+          break;
+        case XI_TouchEnd:
+          type = ButtonRelease;
+          break;
+        case XI_TouchUpdate:
+          type = MotionNotify;
+          break;
         default:
           retval = FALSE;
           break;
@@ -159,6 +168,9 @@ meta_input_event_get_window (MetaDisplay *display,
         case XI_ButtonRelease:
         case XI_KeyPress:
         case XI_KeyRelease:
+        case XI_TouchBegin:
+        case XI_TouchEnd:
+        case XI_TouchUpdate:
           return ((XIDeviceEvent *) xev)->event;
         case XI_FocusIn:
         case XI_FocusOut:
@@ -195,6 +207,9 @@ meta_input_event_get_root_window (MetaDisplay *display,
         case XI_ButtonRelease:
         case XI_KeyPress:
         case XI_KeyRelease:
+        case XI_TouchBegin:
+        case XI_TouchEnd:
+        case XI_TouchUpdate:
           return ((XIDeviceEvent *) xev)->root;
         case XI_FocusIn:
         case XI_FocusOut:
@@ -250,6 +265,9 @@ meta_input_event_get_time (MetaDisplay *display,
         case XI_ButtonRelease:
         case XI_KeyPress:
         case XI_KeyRelease:
+        case XI_TouchBegin:
+        case XI_TouchEnd:
+        case XI_TouchUpdate:
           return ((XIDeviceEvent *) xev)->time;
         case XI_FocusIn:
         case XI_FocusOut:
@@ -312,6 +330,9 @@ meta_input_event_get_coordinates (MetaDisplay *display,
         case XI_ButtonRelease:
         case XI_KeyPress:
         case XI_KeyRelease:
+        case XI_TouchBegin:
+        case XI_TouchEnd:
+        case XI_TouchUpdate:
           {
             XIDeviceEvent *event = (XIDeviceEvent *) xev;
 
@@ -422,6 +443,9 @@ meta_input_event_get_state (MetaDisplay *display,
         case XI_ButtonRelease:
         case XI_KeyPress:
         case XI_KeyRelease:
+        case XI_TouchBegin:
+        case XI_TouchEnd:
+        case XI_TouchUpdate:
           s = ((XIDeviceEvent *) xev)->mods.effective;
           break;
         case XI_FocusIn:
@@ -643,6 +667,9 @@ meta_input_event_get_device (MetaDisplay *display,
         case XI_ButtonRelease:
         case XI_KeyPress:
         case XI_KeyRelease:
+        case XI_TouchBegin:
+        case XI_TouchEnd:
+        case XI_TouchUpdate:
           return meta_device_map_lookup (display->device_map,
                                          ((XIDeviceEvent *) xev)->deviceid);
         case XI_FocusIn:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]