[gimp] Bug 677776 - filter popup windows get hidden behind main image window
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Bug 677776 - filter popup windows get hidden behind main image window
- Date: Mon, 12 Nov 2012 22:44:06 +0000 (UTC)
commit ab801970ca44fbfbbc2902d33f2ac6b70dd0da0f
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].
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 5066761..30b2a84 100644
--- a/libgimp/gimp.c
+++ b/libgimp/gimp.c
@@ -2021,7 +2021,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 f36c2d9..f6242c8 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]