[gimp] app: don't set the GTK_HAS_FOCUS flag on the canvas manually



commit b925e256d305e660619bee7f475e124b45b83013
Author: Michael Natterer <mitch gimp org>
Date:   Mon May 10 20:00:23 2010 +0200

    app: don't set the GTK_HAS_FOCUS flag on the canvas manually
    
    because it's sealed and deprecated. I don't remember why this code was
    there at all (it should never be needed), so I added warnings that go
    off if the widget's focus state doesn't match the received event.

 app/display/gimpdisplayshell-callbacks.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-callbacks.c b/app/display/gimpdisplayshell-callbacks.c
index 9214286..5e076bb 100644
--- a/app/display/gimpdisplayshell-callbacks.c
+++ b/app/display/gimpdisplayshell-callbacks.c
@@ -17,9 +17,6 @@
 
 #include "config.h"
 
-#undef GSEAL_ENABLE
-#undef GTK_DISABLE_DEPRECATED
-
 #include <stdlib.h>
 
 #include <gegl.h>
@@ -784,7 +781,8 @@ gimp_display_shell_canvas_tool_events (GtkWidget        *canvas,
           {
             GIMP_LOG (TOOL_EVENTS, "event (display %p): FOCUS_IN", display);
 
-            GTK_WIDGET_SET_FLAGS (canvas, GTK_HAS_FOCUS);
+            if (G_UNLIKELY (! gtk_widget_has_focus (canvas)))
+              g_warning ("%s: FOCUS_IN but canvas has no focus", G_STRFUNC);
 
             /*  press modifier keys when the canvas gets the focus
              *
@@ -800,7 +798,8 @@ gimp_display_shell_canvas_tool_events (GtkWidget        *canvas,
           {
             GIMP_LOG (TOOL_EVENTS, "event (display %p): FOCUS_OUT", display);
 
-            GTK_WIDGET_UNSET_FLAGS (canvas, GTK_HAS_FOCUS);
+            if (G_LIKELY (gtk_widget_has_focus (canvas)))
+              g_warning ("%s: FOCUS_OUT but canvas has focus", G_STRFUNC);
 
             /*  reset it here to be prepared for the next
              *  FOCUS_IN / BUTTON_PRESS confusion



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