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.
This commit is contained in:
Carlos Garnacho 2011-05-20 22:17:03 +02:00
parent 2c192cf998
commit 3285605c54

View File

@ -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;
}