mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-04 09:53:25 +00:00
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.
This commit is contained in:
parent
6a33951aa6
commit
0b56aa0d13
4 changed files with 39 additions and 8 deletions
|
@ -11,6 +11,11 @@ if PLATFORM_WIN32
|
||||||
no_undefined = -no-undefined
|
no_undefined = -no-undefined
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if PLATFORM_OSX
|
||||||
|
xobjective_c = "-xobjective-c"
|
||||||
|
framework_cocoa = -framework Cocoa
|
||||||
|
endif
|
||||||
|
|
||||||
if OS_WIN32
|
if OS_WIN32
|
||||||
gimp_def = gimp.def
|
gimp_def = gimp.def
|
||||||
gimpui_def = gimpui.def
|
gimpui_def = gimpui.def
|
||||||
|
@ -62,10 +67,11 @@ AM_CPPFLAGS = \
|
||||||
-DGIMP_COMPILATION
|
-DGIMP_COMPILATION
|
||||||
|
|
||||||
INCLUDES = \
|
INCLUDES = \
|
||||||
-I$(top_srcdir) \
|
-I$(top_srcdir) \
|
||||||
$(GTK_CFLAGS) \
|
$(GTK_CFLAGS) \
|
||||||
$(GEGL_CFLAGS) \
|
$(GEGL_CFLAGS) \
|
||||||
-I$(includedir)
|
-I$(includedir) \
|
||||||
|
$(xobjective_c)
|
||||||
|
|
||||||
lib_LTLIBRARIES = libgimp-@GIMP_API_VERSION@.la libgimpui-@GIMP_API_VERSION@.la
|
lib_LTLIBRARIES = libgimp-@GIMP_API_VERSION@.la libgimpui-@GIMP_API_VERSION@.la
|
||||||
|
|
||||||
|
@ -364,7 +370,8 @@ gimpinclude_HEADERS = \
|
||||||
libgimp_@GIMP_API_VERSION@_la_LDFLAGS = \
|
libgimp_@GIMP_API_VERSION@_la_LDFLAGS = \
|
||||||
-version-info $(LT_VERSION_INFO) \
|
-version-info $(LT_VERSION_INFO) \
|
||||||
$(no_undefined) \
|
$(no_undefined) \
|
||||||
$(libgimp_export_symbols)
|
$(libgimp_export_symbols) \
|
||||||
|
$(framework_cocoa)
|
||||||
|
|
||||||
libgimp_@GIMP_API_VERSION@_la_LIBADD = \
|
libgimp_@GIMP_API_VERSION@_la_LIBADD = \
|
||||||
$(libgimpconfig) \
|
$(libgimpconfig) \
|
||||||
|
@ -384,7 +391,8 @@ libgimp_@GIMP_API_VERSION@_la_DEPENDENCIES = \
|
||||||
libgimpui_@GIMP_API_VERSION@_la_LDFLAGS = \
|
libgimpui_@GIMP_API_VERSION@_la_LDFLAGS = \
|
||||||
-version-info $(LT_VERSION_INFO) \
|
-version-info $(LT_VERSION_INFO) \
|
||||||
$(no_undefined) \
|
$(no_undefined) \
|
||||||
$(libgimpui_export_symbols)
|
$(libgimpui_export_symbols) \
|
||||||
|
$(framework_cocoa)
|
||||||
|
|
||||||
libgimpui_@GIMP_API_VERSION@_la_LIBADD = \
|
libgimpui_@GIMP_API_VERSION@_la_LIBADD = \
|
||||||
$(libgimp) \
|
$(libgimp) \
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
#define WAIT_ANY -1
|
#define WAIT_ANY -1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <gtk/gtk.h> /* need GDK_WINDOWING_FOO defines */
|
||||||
|
|
||||||
#ifndef G_OS_WIN32
|
#ifndef G_OS_WIN32
|
||||||
#include "libgimpbase/gimpsignal.h"
|
#include "libgimpbase/gimpsignal.h"
|
||||||
|
@ -82,6 +82,10 @@
|
||||||
|
|
||||||
#endif /* USE_POSIX_SHM */
|
#endif /* USE_POSIX_SHM */
|
||||||
|
|
||||||
|
#ifdef GDK_WINDOWING_QUARTZ
|
||||||
|
#include <Cocoa/Cocoa.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(G_OS_WIN32) || defined(G_WITH_CYGWIN)
|
#if defined(G_OS_WIN32) || defined(G_WITH_CYGWIN)
|
||||||
# define STRICT
|
# define STRICT
|
||||||
# define _WIN32_WINNT 0x0601
|
# define _WIN32_WINNT 0x0601
|
||||||
|
@ -2002,7 +2006,6 @@ gimp_proc_run (GPProcRun *proc_run)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_temp_proc_run (GPProcRun *proc_run)
|
gimp_temp_proc_run (GPProcRun *proc_run)
|
||||||
{
|
{
|
||||||
|
@ -2014,6 +2017,14 @@ gimp_temp_proc_run (GPProcRun *proc_run)
|
||||||
GimpParam *return_vals;
|
GimpParam *return_vals;
|
||||||
gint n_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,
|
(* run_proc) (proc_run->name,
|
||||||
proc_run->nparams,
|
proc_run->nparams,
|
||||||
(GimpParam *) proc_run->params,
|
(GimpParam *) proc_run->params,
|
||||||
|
|
|
@ -28,6 +28,10 @@
|
||||||
#include <gdk/gdkx.h>
|
#include <gdk/gdkx.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef GDK_WINDOWING_QUARTZ
|
||||||
|
#include <Cocoa/Cocoa.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "gimp.h"
|
#include "gimp.h"
|
||||||
#include "gimpui.h"
|
#include "gimpui.h"
|
||||||
|
|
||||||
|
@ -143,6 +147,10 @@ gimp_ui_init (const gchar *prog_name,
|
||||||
|
|
||||||
gimp_dialogs_show_help_button (gimp_show_help_button ());
|
gimp_dialogs_show_help_button (gimp_show_help_button ());
|
||||||
|
|
||||||
|
#ifdef GDK_WINDOWING_QUARTZ
|
||||||
|
[NSApp activateIgnoringOtherApps:YES];
|
||||||
|
#endif
|
||||||
|
|
||||||
gimp_ui_initialized = TRUE;
|
gimp_ui_initialized = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -149,6 +149,10 @@ gimp_dialog_class_init (GimpDialogClass *klass)
|
||||||
static void
|
static void
|
||||||
gimp_dialog_init (GimpDialog *dialog)
|
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_signal_connect (dialog, "response",
|
||||||
G_CALLBACK (gimp_dialog_response),
|
G_CALLBACK (gimp_dialog_response),
|
||||||
NULL);
|
NULL);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue