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



commit ea7c37293c6b104d5774c9543f3699bf509915bb
Author: Michael Natterer <mitch gimp org>
Date:   Wed Oct 21 19:35:20 2009 +0200

    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.

 app/display/gimpdisplayshell-callbacks.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-callbacks.c b/app/display/gimpdisplayshell-callbacks.c
index 90b4658..d46d2b6 100644
--- a/app/display/gimpdisplayshell-callbacks.c
+++ b/app/display/gimpdisplayshell-callbacks.c
@@ -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);



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