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
This commit is contained in:
Jasper St. Pierre 2012-11-20 17:26:19 -05:00
parent 1d827049d6
commit 0fd4059927

View File

@ -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;
}