Commit f3de4b4a authored by Michael Natterer's avatar Michael Natterer 😴

Bug 677776 - filter popup windows get hidden behind main image window

On OSX, call [NSApp activateIgnoringOtherApps] when a plug-in dialog
is shown, so the plug-in process becomes the active app, and the
dialog gets focussed.

In order to avoid doing this in GimpDialog (which is also used in
the core), do it in gimp_ui_init() which all interactive plug-ins
call, and when gimp_temp_proc_run() is called interactively, to
catch repeated activation of an already running plug-in.

Also, set GimpDialog's initial position to GTK_WIN_POS_CENTER,
or they will pop up in the top left corner.

Inspired by patches from Simone Karin Lehmann and Daniel Sabo.
(cherry picked from commit 0b56aa0d)
parent 901f396a
......@@ -11,6 +11,11 @@ if PLATFORM_WIN32
no_undefined = -no-undefined
endif
if PLATFORM_OSX
xobjective_c = "-xobjective-c"
framework_cocoa = -framework Cocoa
endif
if OS_WIN32
gimp_def = gimp.def
gimpui_def = gimpui.def
......@@ -64,7 +69,8 @@ AM_CPPFLAGS = \
INCLUDES = \
-I$(top_srcdir) \
$(GTK_CFLAGS) \
-I$(includedir)
-I$(includedir) \
$(xobjective_c)
lib_LTLIBRARIES = libgimp-2.0.la libgimpui-2.0.la
......@@ -361,7 +367,8 @@ gimpinclude_HEADERS = \
libgimp_2_0_la_LDFLAGS = \
-version-info $(LT_VERSION_INFO) \
$(no_undefined) \
$(libgimp_export_symbols)
$(libgimp_export_symbols) \
$(framework_cocoa)
libgimp_2_0_la_LIBADD = \
$(libgimpconfig) \
......@@ -380,7 +387,8 @@ libgimp_2_0_la_DEPENDENCIES = \
libgimpui_2_0_la_LDFLAGS = \
-version-info $(LT_VERSION_INFO) \
$(no_undefined) \
$(libgimpui_export_symbols)
$(libgimpui_export_symbols) \
$(framework_cocoa)
libgimpui_2_0_la_LIBADD = \
$(libgimp) \
......
......@@ -49,7 +49,7 @@
#define WAIT_ANY -1
#endif
#include <glib-object.h>
#include <gtk/gtk.h> /* need GDK_WINDOWING_FOO defines */
#ifndef G_OS_WIN32
#include "libgimpbase/gimpsignal.h"
......@@ -82,6 +82,10 @@
#endif /* USE_POSIX_SHM */
#ifdef GDK_WINDOWING_QUARTZ
#include <Cocoa/Cocoa.h>
#endif
#if defined(G_OS_WIN32) || defined(G_WITH_CYGWIN)
# define STRICT
# define _WIN32_WINNT 0x0601
......@@ -2003,7 +2007,6 @@ gimp_proc_run (GPProcRun *proc_run)
}
}
static void
gimp_temp_proc_run (GPProcRun *proc_run)
{
......@@ -2015,6 +2018,14 @@ gimp_temp_proc_run (GPProcRun *proc_run)
GimpParam *return_vals;
gint n_return_vals;
#ifdef GDK_WINDOWING_QUARTZ
if (proc_run->params &&
proc_run->params[0].data.d_int32 == GIMP_RUN_INTERACTIVE)
{
[NSApp activateIgnoringOtherApps:YES];
}
#endif
(* run_proc) (proc_run->name,
proc_run->nparams,
(GimpParam *) proc_run->params,
......
......@@ -28,6 +28,10 @@
#include <gdk/gdkx.h>
#endif
#ifdef GDK_WINDOWING_QUARTZ
#include <Cocoa/Cocoa.h>
#endif
#include "libgimpmodule/gimpmodule.h"
#include "gimp.h"
......@@ -143,6 +147,10 @@ gimp_ui_init (const gchar *prog_name,
gimp_dialogs_show_help_button (gimp_show_help_button ());
#ifdef GDK_WINDOWING_QUARTZ
[NSApp activateIgnoringOtherApps:YES];
#endif
gimp_ui_initialized = TRUE;
}
......
......@@ -149,6 +149,10 @@ gimp_dialog_class_init (GimpDialogClass *klass)
static void
gimp_dialog_init (GimpDialog *dialog)
{
#ifdef GDK_WINDOWING_QUARTZ
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER);
#endif
g_signal_connect (dialog, "response",
G_CALLBACK (gimp_dialog_response),
NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment