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



commit 2b322ad32c4ed1c712eec440f1ea34300b19143f
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 934ade2..944dbc4 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]