[caribou: 17/23] Fix the gtk2 module



commit c874366acbcbc6ec16f378c38794516ba441c589
Author: Dan Winship <danw gnome org>
Date:   Fri Aug 5 13:06:54 2011 -0400

    Fix the gtk2 module

 modules/gtk3/caribou-gtk-module.vala |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/modules/gtk3/caribou-gtk-module.vala b/modules/gtk3/caribou-gtk-module.vala
index 283e361..f74404a 100644
--- a/modules/gtk3/caribou-gtk-module.vala
+++ b/modules/gtk3/caribou-gtk-module.vala
@@ -29,14 +29,23 @@ namespace Caribou {
         }
 
         private Gdk.FilterReturn event_filter (Gdk.XEvent xevent, Gdk.Event evt) {
+            Gdk.Window? gdkwindow;
             void* data;
             Gtk.Window window;
 
-            if (evt.any.window == null ||
-                evt.any.window.get_window_type () != Gdk.WindowType.TOPLEVEL)
+#if GTK2
+            void* pointer = &xevent;
+            X.Event* xev = (X.Event *) pointer;
+            gdkwindow = (Gdk.Window) Gdk.x11_xid_table_lookup_for_display (display, (X.ID) xev.xany.window);
+#else
+            gdkwindow = evt.any.window;
+#endif
+
+            if (gdkwindow == null ||
+                gdkwindow.get_window_type () != Gdk.WindowType.TOPLEVEL)
                 return Gdk.FilterReturn.CONTINUE;
 
-            Gdk.window_get_user_data (evt.any.window, out data);
+            Gdk.window_get_user_data (gdkwindow, out data);
             if (data == null || !(data is Gtk.Window))
                 return Gdk.FilterReturn.CONTINUE;
 



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