From 83de53ee4de56c41694b7196345586e8f6578d23 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Tue, 13 Nov 2012 00:45:45 +0100 Subject: [PATCH] Bug 677776 - filter popup windows get hidden behind main image window Apply modified patch from Simone Karin Lehmann which makes sure script-fu gets properly hidden after the dialog is done. --- plug-ins/script-fu/Makefile.am | 26 ++++++++++++++++-------- plug-ins/script-fu/script-fu-interface.c | 16 +++++++++++++++ 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/plug-ins/script-fu/Makefile.am b/plug-ins/script-fu/Makefile.am index 9a388c8993..e8352e5691 100644 --- a/plug-ins/script-fu/Makefile.am +++ b/plug-ins/script-fu/Makefile.am @@ -1,5 +1,10 @@ ## Process this file with automake to produce Makefile.in +if PLATFORM_OSX +xobjective_c = "-xobjective-c" +framework_cocoa = -framework Cocoa +endif + if OS_WIN32 mwindows = -mwindows WINSOCK_LIBS = -lws2_32 @@ -24,15 +29,20 @@ script_fu_RC = script-fu.rc.o endif AM_CFLAGS = \ - -DSTANDALONE=0 \ - -DUSE_INTERFACE=1 \ - -DUSE_STRLWR=0 \ - -I$(top_srcdir) \ - $(GTK_CFLAGS) \ - $(GEGL_CFLAGS) \ - -I$(includedir) + -DSTANDALONE=0 \ + -DUSE_INTERFACE=1 \ + -DUSE_STRLWR=0 -AM_LDFLAGS = $(mwindows) +INCLUDES = \ + -I$(top_srcdir) \ + $(GTK_CFLAGS) \ + $(GEGL_CFLAGS) \ + -I$(includedir) \ + $(xobjective_c) + +AM_LDFLAGS = \ + $(mwindows) \ + $(framework_cocoa) SUBDIRS = tinyscheme ftx scripts diff --git a/plug-ins/script-fu/script-fu-interface.c b/plug-ins/script-fu/script-fu-interface.c index 053c637802..b94571fcd0 100644 --- a/plug-ins/script-fu/script-fu-interface.c +++ b/plug-ins/script-fu/script-fu-interface.c @@ -22,6 +22,10 @@ #include #include +#ifdef GDK_WINDOWING_QUARTZ +#import +#endif + #include "tinyscheme/scheme-private.h" #include "scheme-wrapper.h" @@ -737,11 +741,23 @@ script_fu_response (GtkWidget *widget, gtk_widget_set_sensitive (action_area, FALSE); script_fu_ok (script); + +#ifdef GDK_WINDOWING_QUARTZ + [NSApp hide: nil]; + while (g_main_context_pending (NULL)) + g_main_context_iteration (NULL, TRUE); +#endif gtk_widget_destroy (sf_interface->dialog); break; default: sf_status = GIMP_PDB_CANCEL; + +#ifdef GDK_WINDOWING_QUARTZ + [NSApp hide: nil]; + while (g_main_context_pending (NULL)) + g_main_context_iteration (NULL, TRUE); +#endif gtk_widget_destroy (sf_interface->dialog); break; }