]> Pileus Git - ~andy/gtk/commitdiff
Call the filters on the window where the event is received, not on the
authorOwen Taylor <otaylor@redhat.com>
Thu, 19 Dec 2002 16:51:02 +0000 (16:51 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Thu, 19 Dec 2002 16:51:02 +0000 (16:51 +0000)
Thu Dec 19 11:42:00 2002  Owen Taylor  <otaylor@redhat.com>

        * gdk/x11/gdkevents-x11.c (gdk_event_translate): Call
        the filters on the window where the event is received,
        not on the window the event is "about". (#101512,
        Bolian Yin.)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/x11/gdkevents-x11.c

index 8f98ebf0fdf781062d61b74125dc2c8d9bbf2728..02cc399e11b00a8b3fe3a59a0eaaed533c0766bc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Thu Dec 19 11:42:00 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkevents-x11.c (gdk_event_translate): Call
+       the filters on the window where the event is received,
+       not on the window the event is "about". (#101512,
+       Bolian Yin.)
+
 Thu Dec 19 03:58:36 2002  Kristian Rietveld  <kris@gtk.org>
 
        * tests/testtreeflow.c: the rand variable should be static to
index 8f98ebf0fdf781062d61b74125dc2c8d9bbf2728..02cc399e11b00a8b3fe3a59a0eaaed533c0766bc 100644 (file)
@@ -1,3 +1,10 @@
+Thu Dec 19 11:42:00 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkevents-x11.c (gdk_event_translate): Call
+       the filters on the window where the event is received,
+       not on the window the event is "about". (#101512,
+       Bolian Yin.)
+
 Thu Dec 19 03:58:36 2002  Kristian Rietveld  <kris@gtk.org>
 
        * tests/testtreeflow.c: the rand variable should be static to
index 8f98ebf0fdf781062d61b74125dc2c8d9bbf2728..02cc399e11b00a8b3fe3a59a0eaaed533c0766bc 100644 (file)
@@ -1,3 +1,10 @@
+Thu Dec 19 11:42:00 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkevents-x11.c (gdk_event_translate): Call
+       the filters on the window where the event is received,
+       not on the window the event is "about". (#101512,
+       Bolian Yin.)
+
 Thu Dec 19 03:58:36 2002  Kristian Rietveld  <kris@gtk.org>
 
        * tests/testtreeflow.c: the rand variable should be static to
index 8f98ebf0fdf781062d61b74125dc2c8d9bbf2728..02cc399e11b00a8b3fe3a59a0eaaed533c0766bc 100644 (file)
@@ -1,3 +1,10 @@
+Thu Dec 19 11:42:00 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkevents-x11.c (gdk_event_translate): Call
+       the filters on the window where the event is received,
+       not on the window the event is "about". (#101512,
+       Bolian Yin.)
+
 Thu Dec 19 03:58:36 2002  Kristian Rietveld  <kris@gtk.org>
 
        * tests/testtreeflow.c: the rand variable should be static to
index 8f98ebf0fdf781062d61b74125dc2c8d9bbf2728..02cc399e11b00a8b3fe3a59a0eaaed533c0766bc 100644 (file)
@@ -1,3 +1,10 @@
+Thu Dec 19 11:42:00 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkevents-x11.c (gdk_event_translate): Call
+       the filters on the window where the event is received,
+       not on the window the event is "about". (#101512,
+       Bolian Yin.)
+
 Thu Dec 19 03:58:36 2002  Kristian Rietveld  <kris@gtk.org>
 
        * tests/testtreeflow.c: the rand variable should be static to
index 8f98ebf0fdf781062d61b74125dc2c8d9bbf2728..02cc399e11b00a8b3fe3a59a0eaaed533c0766bc 100644 (file)
@@ -1,3 +1,10 @@
+Thu Dec 19 11:42:00 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkevents-x11.c (gdk_event_translate): Call
+       the filters on the window where the event is received,
+       not on the window the event is "about". (#101512,
+       Bolian Yin.)
+
 Thu Dec 19 03:58:36 2002  Kristian Rietveld  <kris@gtk.org>
 
        * tests/testtreeflow.c: the rand variable should be static to
index f0e44e8b06db4f6b55209a2560d4c3148a67bc06..e32fe2182b29e0ed00d7a3a1e77b9078ba9fc2d2 100644 (file)
@@ -688,6 +688,7 @@ gdk_event_translate (GdkDisplay *display,
   
   GdkWindow *window;
   GdkWindowObject *window_private;
+  GdkWindow *filter_window;
   GdkWindowImplX11 *window_impl = NULL;
   gint return_val;
   gint xoffset, yoffset;
@@ -742,6 +743,14 @@ gdk_event_translate (GdkDisplay *display,
   window = gdk_window_lookup_for_display (display, xwindow);
   window_private = (GdkWindowObject *) window;
 
+  /* We always run the filters for the window where the event
+   * is delivered, not the window that it relates to
+   */
+  if (xevent->xany.window == xwindow)
+    filter_window = window;
+  else
+    filter_window = gdk_window_lookup_for_display (display, xevent->xany.window);
+
   if (window)
     {
       screen = GDK_WINDOW_SCREEN (window);
@@ -791,17 +800,26 @@ gdk_event_translate (GdkDisplay *display,
          goto done;
        }
     }
-  else if (window_private)
+  else if (filter_window)
     {
       /* Apply per-window filters */
+      GdkWindowObject *filter_private = (GdkWindowObject *) filter_window;
       GdkFilterReturn result;
-      result = gdk_event_apply_filters (xevent, event,
-                                       window_private->filters);
-      
-      if (result != GDK_FILTER_CONTINUE)
+
+      if (filter_private->filters)
        {
-         return_val = (result == GDK_FILTER_TRANSLATE) ? TRUE : FALSE;
-         goto done;
+         g_object_ref (filter_window);
+         
+         result = gdk_event_apply_filters (xevent, event,
+                                           filter_private->filters);
+         
+         g_object_unref (filter_window);
+      
+         if (result != GDK_FILTER_CONTINUE)
+           {
+             return_val = (result == GDK_FILTER_TRANSLATE) ? TRUE : FALSE;
+             goto done;
+           }
        }
     }