[mutter/wip/xinput2b: 12/19] compositor: Identify XI2 events as grabbed events
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/xinput2b: 12/19] compositor: Identify XI2 events as grabbed events
- Date: Wed, 21 Nov 2012 02:42:46 +0000 (UTC)
commit a2d8ba9e4b61c7baa7b34f58b8d4712fd5848894
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Nov 20 19:27:02 2012 -0500
compositor: Identify XI2 events as grabbed events
https://bugzilla.gnome.org/show_bug.cgi?id=688779
src/compositor/compositor.c | 23 ++++++++++++++++++++---
1 files changed, 20 insertions(+), 3 deletions(-)
---
diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c
index 3427ee1..9c86e03 100644
--- a/src/compositor/compositor.c
+++ b/src/compositor/compositor.c
@@ -715,9 +715,26 @@ meta_compositor_set_updates (MetaCompositor *compositor,
}
static gboolean
-is_grabbed_event (XEvent *event)
+is_grabbed_event (MetaDisplay *display,
+ XEvent *event)
{
- switch (event->xany.type)
+ if (event->type == GenericEvent &&
+ event->xcookie.extension == display->xinput2_opcode)
+ {
+ XIEvent *xev = (XIEvent *) event->xcookie.data;
+
+ switch (xev->evtype)
+ {
+ case XI_Motion:
+ case XI_ButtonPress:
+ case XI_ButtonRelease:
+ case XI_KeyPress:
+ case XI_KeyRelease:
+ return TRUE;
+ }
+ }
+
+ switch (event->type)
{
case ButtonPress:
case ButtonRelease:
@@ -750,7 +767,7 @@ meta_compositor_process_event (MetaCompositor *compositor,
XEvent *event,
MetaWindow *window)
{
- if (compositor->modal_plugin && is_grabbed_event (event))
+ if (compositor->modal_plugin && is_grabbed_event (compositor->display, event))
{
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (compositor->modal_plugin);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]