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:
Michael Natterer
2012-11-07 23:44:35 +01:00
parent 6a33951aa6
commit 0b56aa0d13
4 changed files with 39 additions and 8 deletions

View File

@ -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
@ -2002,7 +2006,6 @@ gimp_proc_run (GPProcRun *proc_run)
}
}
static void
gimp_temp_proc_run (GPProcRun *proc_run)
{
@ -2014,6 +2017,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,