win32: Always pass a window to the default event filters
This has to happen or the event filter cannot identify what type of display the event is from (ie if it's an XEvent, a broadway event or a win32 MSG.
This commit is contained in:
committed by
Benjamin Otte
parent
f9c2982ddc
commit
033fb5a879
@ -936,8 +936,7 @@ apply_event_filters (GdkWindow *window,
|
|||||||
GList *tmp_list;
|
GList *tmp_list;
|
||||||
|
|
||||||
event = gdk_event_new (GDK_NOTHING);
|
event = gdk_event_new (GDK_NOTHING);
|
||||||
if (window != NULL)
|
event->any.window = g_object_ref (window);
|
||||||
event->any.window = g_object_ref (window);
|
|
||||||
((GdkEventPrivate *)event)->flags |= GDK_EVENT_PENDING;
|
((GdkEventPrivate *)event)->flags |= GDK_EVENT_PENDING;
|
||||||
|
|
||||||
/* I think GdkFilterFunc semantics require the passed-in event
|
/* I think GdkFilterFunc semantics require the passed-in event
|
||||||
@ -1913,11 +1912,15 @@ gdk_event_translate (MSG *msg,
|
|||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
window = gdk_win32_handle_table_lookup (msg->hwnd);
|
||||||
|
|
||||||
if (_gdk_default_filters)
|
if (_gdk_default_filters)
|
||||||
{
|
{
|
||||||
/* Apply global filters */
|
/* Apply global filters */
|
||||||
|
|
||||||
GdkFilterReturn result = apply_event_filters (NULL, msg, &_gdk_default_filters);
|
GdkFilterReturn result = apply_event_filters (window ? window : gdk_screen_get_root_window (gdk_display_get_default_screen (_gdk_display)),
|
||||||
|
msg,
|
||||||
|
&_gdk_default_filters);
|
||||||
|
|
||||||
/* If result is GDK_FILTER_CONTINUE, we continue as if nothing
|
/* If result is GDK_FILTER_CONTINUE, we continue as if nothing
|
||||||
* happened. If it is GDK_FILTER_REMOVE or GDK_FILTER_TRANSLATE,
|
* happened. If it is GDK_FILTER_REMOVE or GDK_FILTER_TRANSLATE,
|
||||||
@ -1927,8 +1930,6 @@ gdk_event_translate (MSG *msg,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
window = gdk_win32_handle_table_lookup (msg->hwnd);
|
|
||||||
|
|
||||||
if (window == NULL)
|
if (window == NULL)
|
||||||
{
|
{
|
||||||
/* XXX Handle WM_QUIT here ? */
|
/* XXX Handle WM_QUIT here ? */
|
||||||
|
|||||||
Reference in New Issue
Block a user