[mutter] display: Only care about input events for the VCP/VCK



commit 0fd40599279c8b5f2a32e7dc00491a3f14de76a7
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Nov 20 17:26:19 2012 -0500

    display: Only care about input events for the VCP/VCK
    
    It's unlikely that we'll ever want to support multiple pointer
    devices. Multiple keyboard devices may become useful in the future,
    but for now, only care about the core keyboard.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=688779

 src/core/display.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/core/display.c b/src/core/display.c
index a8acc9e..f557ade 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -75,6 +75,7 @@
 #include <unistd.h>
 
 /* This is set in stone and also hard-coded in GDK. */
+#define VIRTUAL_CORE_POINTER_ID 2
 #define VIRTUAL_CORE_KEYBOARD_ID 3
 
 #define GRAB_OP_IS_WINDOW_SWITCH(g)                     \
@@ -1815,13 +1816,20 @@ get_input_event (MetaDisplay *display,
         case XI_Motion:
         case XI_ButtonPress:
         case XI_ButtonRelease:
+          if (((XIDeviceEvent *) input_event)->deviceid == VIRTUAL_CORE_POINTER_ID)
+            return input_event;
         case XI_KeyPress:
         case XI_KeyRelease:
+          if (((XIDeviceEvent *) input_event)->deviceid == VIRTUAL_CORE_KEYBOARD_ID)
+            return input_event;
         case XI_FocusIn:
         case XI_FocusOut:
+          if (((XIEnterEvent *) input_event)->deviceid == VIRTUAL_CORE_KEYBOARD_ID)
+            return input_event;
         case XI_Enter:
         case XI_Leave:
-          return input_event;
+          if (((XIEnterEvent *) input_event)->deviceid == VIRTUAL_CORE_POINTER_ID)
+            return input_event;
         default:
           break;
         }



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