[mutter/wip/xinput2b: 20/31] display: Only care about input events for the VCP/VCK



commit 8a9c659e222ec0b79c438d5bcff267cd26deacd8
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
    
    https://bugzilla.gnome.org/show_bug.cgi?id=688779

 src/core/display.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/core/display.c b/src/core/display.c
index 71a71f6..5e479ac 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)                     \
@@ -1804,19 +1805,27 @@ get_input_event (MetaDisplay *display,
       event->xcookie.extension == display->xinput2_opcode)
     {
       XIEvent *xev;
+      XIDeviceEvent *xev_d;
 
       /* NB: GDK event filters already have generic events
        * allocated, so no need to do XGetEventData() on our own
        */
       xev = (XIEvent *) event->xcookie.data;
+      xev_d = (XIDeviceEvent *) xev;
 
       switch (xev->evtype)
         {
         case XI_Motion:
         case XI_ButtonPress:
         case XI_ButtonRelease:
+          if (xev_d->deviceid == VIRTUAL_CORE_POINTER_ID)
+            return xev;
+          break;
         case XI_KeyPress:
         case XI_KeyRelease:
+          if (xev_d->deviceid == VIRTUAL_CORE_KEYBOARD_ID)
+            return xev;
+          break;
         case XI_FocusIn:
         case XI_FocusOut:
         case XI_Enter:



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