[gtk+] gdk: do not fallback to event->xany.window in GdkEventTranslator



commit 3285605c541f1e550d60c2110292755cd8e48728
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri May 20 22:17:03 2011 +0200

    gdk: do not fallback to event->xany.window in GdkEventTranslator
    
    This is already done in gdk_event_source_get_filter_window(), and
    could lead to wrong event assignment if an event translator happens
    to return a window for an event it doesn't handle.

 gdk/x11/gdkeventtranslator.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/gdk/x11/gdkeventtranslator.c b/gdk/x11/gdkeventtranslator.c
index 4589b1d..3b75948 100644
--- a/gdk/x11/gdkeventtranslator.c
+++ b/gdk/x11/gdkeventtranslator.c
@@ -94,17 +94,13 @@ _gdk_x11_event_translator_get_window (GdkEventTranslator *translator,
                                       XEvent             *xevent)
 {
   GdkEventTranslatorIface *iface;
-  GdkWindow *window = NULL;
 
   g_return_val_if_fail (GDK_IS_EVENT_TRANSLATOR (translator), NULL);
 
   iface = GDK_EVENT_TRANSLATOR_GET_IFACE (translator);
 
   if (iface->get_window)
-    window = iface->get_window (translator, xevent);
+    return iface->get_window (translator, xevent);
 
-  if (!window)
-    window = gdk_x11_window_lookup_for_display (display, xevent->xany.window);
-
-  return window;
+  return NULL;
 }



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