[gimp/gimp-2-8] Bug 567333 - Using tab to toggle docked "utility windows" does not...



commit ed7896a8387760c7a540b86182a087a519b3e4af
Author: Michael Natterer <mitch gimp org>
Date:   Wed Oct 29 23:30:45 2014 +0100

    Bug 567333 - Using tab to toggle docked "utility windows" does not...
    
    ...bring focus back to GIMP image window
    
    When showing docks in multi-window-mode, try to set the keyboard focus
    back to the active display because it might have been stolen by a dock.
    
    (cherry picked from commit 225a0ce27c5b878edf9f8c3f5cae15bcf474259e)

 app/display/gimpimagewindow.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/app/display/gimpimagewindow.c b/app/display/gimpimagewindow.c
index e8e2e09..f1300b1 100644
--- a/app/display/gimpimagewindow.c
+++ b/app/display/gimpimagewindow.c
@@ -1560,6 +1560,30 @@ gimp_image_window_config_notify (GimpImageWindow *window,
       gtk_widget_set_visible (private->left_docks, show_docks);
       gtk_widget_set_visible (private->right_docks, show_docks);
       gimp_image_window_update_tabs (window);
+
+      /* If docks are being shown, and we are in multi-window-mode,
+       * and this is the window of the active display, try to set
+       * the keyboard focus to this window because it might have
+       * been stolen by a dock. See bug #567333.
+       */
+      if (strcmp (pspec->name, "hide-docks") == 0 &&
+          ! config->single_window_mode            &&
+          ! config->hide_docks)
+        {
+          GimpDisplayShell *shell;
+          GimpContext      *user_context;
+
+          shell        = gimp_image_window_get_active_shell (window);
+          user_context = gimp_get_user_context (private->gimp);
+
+          if (gimp_context_get_display (user_context) == shell->display)
+            {
+              GdkWindow *w = gtk_widget_get_window (GTK_WIDGET (window));
+
+              if (w)
+                gdk_window_focus (w, gtk_get_current_event_time ());
+            }
+        }
     }
 
   /* Session management */


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