[gtk+/composite-templates] Fix DND keyboard control with XI2
- From: Juan Pablo Ugarte <jpu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/composite-templates] Fix DND keyboard control with XI2
- Date: Fri, 14 Sep 2012 21:10:16 +0000 (UTC)
commit 23c5f2ac8e8b4d433b14bf7b70d7877c505ef452
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Aug 6 22:56:59 2012 -0400
Fix DND keyboard control with XI2
We are using XI2 to grab the key events, but we did not do the
necessary extra work to make GDK deliver root window events to us.
https://bugzilla.gnome.org/show_bug.cgi?id=681006
gtk/gtkdnd.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index 27a615e..42f7221 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -411,6 +411,18 @@ root_key_filter (GdkXEvent *xevent,
if ((ev->type == KeyPress || ev->type == KeyRelease) &&
ev->xkey.root == ev->xkey.window)
ev->xkey.window = (Window)data;
+ else if (ev->type == GenericEvent)
+ {
+ XGenericEventCookie *cookie;
+ XIDeviceEvent *dev;
+
+ cookie = &ev->xcookie;
+ dev = (XIDeviceEvent *) cookie->data;
+
+ if (dev->evtype == XI_KeyPress ||
+ dev->evtype == XI_KeyRelease)
+ dev->event = (Window)data;
+ }
return GDK_FILTER_CONTINUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]