Fix event filter handling. If an event filter (global, client message
2005-03-30 Tor Lillqvist <tml@novell.com> * gdk/win32/gdkevents-win32.c (gdk_event_translate): Fix event filter handling. If an event filter (global, client message filter, of window-specific) returns GDK_FILTER_CONTINUE, continue as if nothing happened. If it returns GDK_FILTER_REMOVE or GDK_FILTER_TRANSLATE, return TRUE from gdk_event_translate() which means that DefWindowProc() will not be called. (gdk_event_translate): Fix client message handling. Append a GDK_CLIENT_EVENT unless there is a filter that matches and returns something other than GDK_FILTER_CONTINUE. (#135552)
This commit is contained in:
parent
3618011a5a
commit
681afb7b6a
@ -3,6 +3,15 @@
|
|||||||
* gdk/win32/gdkevents-win32.c (build_pointer_event_state): The
|
* gdk/win32/gdkevents-win32.c (build_pointer_event_state): The
|
||||||
state field should represent the state before the event, like on
|
state field should represent the state before the event, like on
|
||||||
X11. (#169753)
|
X11. (#169753)
|
||||||
|
(gdk_event_translate): Fix event filter handling. If an event
|
||||||
|
filter (global, client message filter, of window-specific) returns
|
||||||
|
GDK_FILTER_CONTINUE, continue as if nothing happened. If it
|
||||||
|
returns GDK_FILTER_REMOVE or GDK_FILTER_TRANSLATE, return TRUE
|
||||||
|
from gdk_event_translate() which means that DefWindowProc() will
|
||||||
|
not be called.
|
||||||
|
(gdk_event_translate): Fix client message handling. Append a
|
||||||
|
GDK_CLIENT_EVENT unless there is a filter that matches and returns
|
||||||
|
something other than GDK_FILTER_CONTINUE. (#135552)
|
||||||
|
|
||||||
2005-03-29 Matthias Clasen <mclasen@redhat.com>
|
2005-03-29 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
@ -3,6 +3,15 @@
|
|||||||
* gdk/win32/gdkevents-win32.c (build_pointer_event_state): The
|
* gdk/win32/gdkevents-win32.c (build_pointer_event_state): The
|
||||||
state field should represent the state before the event, like on
|
state field should represent the state before the event, like on
|
||||||
X11. (#169753)
|
X11. (#169753)
|
||||||
|
(gdk_event_translate): Fix event filter handling. If an event
|
||||||
|
filter (global, client message filter, of window-specific) returns
|
||||||
|
GDK_FILTER_CONTINUE, continue as if nothing happened. If it
|
||||||
|
returns GDK_FILTER_REMOVE or GDK_FILTER_TRANSLATE, return TRUE
|
||||||
|
from gdk_event_translate() which means that DefWindowProc() will
|
||||||
|
not be called.
|
||||||
|
(gdk_event_translate): Fix client message handling. Append a
|
||||||
|
GDK_CLIENT_EVENT unless there is a filter that matches and returns
|
||||||
|
something other than GDK_FILTER_CONTINUE. (#135552)
|
||||||
|
|
||||||
2005-03-29 Matthias Clasen <mclasen@redhat.com>
|
2005-03-29 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
@ -3,6 +3,15 @@
|
|||||||
* gdk/win32/gdkevents-win32.c (build_pointer_event_state): The
|
* gdk/win32/gdkevents-win32.c (build_pointer_event_state): The
|
||||||
state field should represent the state before the event, like on
|
state field should represent the state before the event, like on
|
||||||
X11. (#169753)
|
X11. (#169753)
|
||||||
|
(gdk_event_translate): Fix event filter handling. If an event
|
||||||
|
filter (global, client message filter, of window-specific) returns
|
||||||
|
GDK_FILTER_CONTINUE, continue as if nothing happened. If it
|
||||||
|
returns GDK_FILTER_REMOVE or GDK_FILTER_TRANSLATE, return TRUE
|
||||||
|
from gdk_event_translate() which means that DefWindowProc() will
|
||||||
|
not be called.
|
||||||
|
(gdk_event_translate): Fix client message handling. Append a
|
||||||
|
GDK_CLIENT_EVENT unless there is a filter that matches and returns
|
||||||
|
something other than GDK_FILTER_CONTINUE. (#135552)
|
||||||
|
|
||||||
2005-03-29 Matthias Clasen <mclasen@redhat.com>
|
2005-03-29 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
@ -2192,14 +2192,11 @@ gdk_event_translate (GdkDisplay *display,
|
|||||||
apply_filters (display, NULL, msg, _gdk_default_filters);
|
apply_filters (display, NULL, 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, we return FALSE from
|
* happened. If it is GDK_FILTER_REMOVE or GDK_FILTER_TRANSLATE,
|
||||||
* gdk_event_translate(), meaning that the DefWindowProc() will
|
* we return TRUE, and DefWindowProc() will not be called.
|
||||||
* be called. If it is GDK_FILTER_TRANSLATE, we return TRUE, and
|
|
||||||
* DefWindowProc() will not be called.
|
|
||||||
*/
|
*/
|
||||||
if (result == GDK_FILTER_REMOVE)
|
if (result == GDK_FILTER_REMOVE ||
|
||||||
return FALSE;
|
result == GDK_FILTER_TRANSLATE)
|
||||||
else if (result == GDK_FILTER_TRANSLATE)
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2256,12 +2253,8 @@ gdk_event_translate (GdkDisplay *display,
|
|||||||
GdkFilterReturn result =
|
GdkFilterReturn result =
|
||||||
apply_filters (display, window, msg, ((GdkWindowObject *) window)->filters);
|
apply_filters (display, window, msg, ((GdkWindowObject *) window)->filters);
|
||||||
|
|
||||||
if (result == GDK_FILTER_REMOVE)
|
if (result == GDK_FILTER_REMOVE ||
|
||||||
{
|
result == GDK_FILTER_TRANSLATE)
|
||||||
return_val = FALSE;
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
else if (result == GDK_FILTER_TRANSLATE)
|
|
||||||
{
|
{
|
||||||
return_val = TRUE;
|
return_val = TRUE;
|
||||||
goto done;
|
goto done;
|
||||||
@ -2318,34 +2311,39 @@ gdk_event_translate (GdkDisplay *display,
|
|||||||
else if (msg->message == client_message)
|
else if (msg->message == client_message)
|
||||||
{
|
{
|
||||||
GList *tmp_list;
|
GList *tmp_list;
|
||||||
|
GdkFilterReturn result = GDK_FILTER_CONTINUE;
|
||||||
|
|
||||||
|
GDK_NOTE (EVENTS, g_print (" client_message"));
|
||||||
|
|
||||||
tmp_list = client_filters;
|
tmp_list = client_filters;
|
||||||
while (tmp_list)
|
while (tmp_list)
|
||||||
{
|
{
|
||||||
GdkClientFilter *filter = tmp_list->data;
|
GdkClientFilter *filter = tmp_list->data;
|
||||||
|
|
||||||
|
tmp_list = tmp_list->next;
|
||||||
|
|
||||||
if (filter->type == GDK_POINTER_TO_ATOM (msg->wParam))
|
if (filter->type == GDK_POINTER_TO_ATOM (msg->wParam))
|
||||||
{
|
{
|
||||||
GList *this_filter = g_list_append (NULL, filter);
|
GList *filter_list = g_list_append (NULL, filter);
|
||||||
|
|
||||||
GdkFilterReturn result =
|
GDK_NOTE (EVENTS, g_print (" (match)"));
|
||||||
apply_filters (display, window, msg, this_filter);
|
|
||||||
|
|
||||||
GDK_NOTE (EVENTS, g_print (" (client filter match)"));
|
result = apply_filters (display, window, msg, filter_list);
|
||||||
|
|
||||||
g_list_free (this_filter);
|
g_list_free (filter_list);
|
||||||
|
|
||||||
if (result == GDK_FILTER_REMOVE)
|
if (result != GDK_FILTER_CONTINUE)
|
||||||
{
|
break;
|
||||||
return_val = FALSE;
|
|
||||||
goto done;
|
|
||||||
}
|
}
|
||||||
else if (result == GDK_FILTER_TRANSLATE)
|
}
|
||||||
|
|
||||||
|
if (result == GDK_FILTER_REMOVE ||
|
||||||
|
result == GDK_FILTER_TRANSLATE)
|
||||||
{
|
{
|
||||||
return_val = TRUE;
|
return_val = TRUE;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
else /* GDK_FILTER_CONTINUE */
|
else
|
||||||
{
|
{
|
||||||
/* Send unknown client messages on to Gtk for it to use */
|
/* Send unknown client messages on to Gtk for it to use */
|
||||||
|
|
||||||
@ -2363,9 +2361,6 @@ gdk_event_translate (GdkDisplay *display,
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tmp_list = tmp_list->next;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (msg->message)
|
switch (msg->message)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user