Don't block all key events on the canvas (fixes tool interaction)

(gimp_display_shell_canvas_tool_events): when ignoring events on
overlays, special case key events because they always originate from
the topelvel and never from the canvas' window itself.
This commit is contained in:
Michael Natterer 2009-10-21 19:35:20 +02:00
parent a93cb543ff
commit ea7c37293c
1 changed files with 9 additions and 3 deletions

View File

@ -619,9 +619,15 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
if (gimp_display_shell_events (canvas, event, shell))
return TRUE;
/* ignore events on overlays */
if (((GdkEventAny *) event)->window != canvas->window)
return FALSE;
/* ignore events on overlays, but make sure key events go through
* anyway because they are always originating from the toplevel
*/
if (event->type != GDK_KEY_PRESS &&
event->type != GDK_KEY_RELEASE &&
((GdkEventAny *) event)->window != canvas->window)
{
return FALSE;
}
display = shell->display;
gimp = gimp_display_get_gimp (display);