[gimp/gimp-2-8] Bug 677776 - filter popup windows get hidden behind main image window



commit 3291348ac6e6c383112ec0183b4b3d5104d01e03
Author: Michael Natterer <mitch gimp org>
Date:   Mon Nov 12 23:42:15 2012 +0100

    Bug 677776 - filter popup windows get hidden behind main image window
    
    Simone found a better way than setting plug-in windows to UTILITY: simply
    call the proper API, [NSApp arrangeInFront: nil].
    (cherry picked from commit ab801970ca44fbfbbc2902d33f2ac6b70dd0da0f)

 libgimp/gimp.c   |    2 +-
 libgimp/gimpui.c |   27 +++++++++++++++++----------
 2 files changed, 18 insertions(+), 11 deletions(-)
---
diff --git a/libgimp/gimp.c b/libgimp/gimp.c
index b4fdb47..a7a6424 100644
--- a/libgimp/gimp.c
+++ b/libgimp/gimp.c
@@ -2022,7 +2022,7 @@ gimp_temp_proc_run (GPProcRun *proc_run)
       if (proc_run->params &&
           proc_run->params[0].data.d_int32 == GIMP_RUN_INTERACTIVE)
         {
-          [NSApp activateIgnoringOtherApps:YES];
+          [NSApp activateIgnoringOtherApps: YES];
         }
 #endif
 
diff --git a/libgimp/gimpui.c b/libgimp/gimpui.c
index 8e0a1ca..5e9f6f1 100644
--- a/libgimp/gimpui.c
+++ b/libgimp/gimpui.c
@@ -231,6 +231,17 @@ gimp_ui_get_progress_window (void)
   return NULL;
 }
 
+#ifdef GDK_WINDOWING_QUARTZ
+static void
+gimp_window_transient_show (GtkWidget *window)
+{
+  g_signal_handlers_disconnect_by_func (window,
+                                        gimp_window_transient_show,
+                                        NULL);
+  [NSApp arrangeInFront: nil];
+}
+#endif
+
 /**
  * gimp_window_set_transient_for_display:
  * @window:   the #GtkWindow that should become transient
@@ -262,14 +273,9 @@ gimp_window_set_transient_for_display (GtkWindow *window,
       gtk_window_set_position (window, GTK_WIN_POS_CENTER);
 
 #ifdef GDK_WINDOWING_QUARTZ
-      /*  in OSX, bringing the plug-in's window to front hilariously
-       *  fails even though we call [NSApp activateIgnoringOtherApps];
-       *  as a workaround, set the window to UTILITY which places them
-       *  above all normal windows (which sucks, but it's better than
-       *  below the image window, and not that bad because plug-in
-       *  windows are generally temporary, see bug #677776).
-       */
-      gtk_window_set_type_hint (window, GDK_WINDOW_TYPE_HINT_UTILITY);
+      g_signal_connect (window, "show",
+                        G_CALLBACK (gimp_window_transient_show),
+                        NULL);
 #endif
     }
 }
@@ -296,8 +302,9 @@ gimp_window_set_transient (GtkWindow *window)
       gtk_window_set_position (window, GTK_WIN_POS_CENTER);
 
 #ifdef GDK_WINDOWING_QUARTZ
-      /*  ditto  */
-      gtk_window_set_type_hint (window, GDK_WINDOW_TYPE_HINT_UTILITY);
+      g_signal_connect (window, "show",
+                        G_CALLBACK (gimp_window_transient_show),
+                        NULL);
 #endif
     }
 }



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