[gimp] Return FALSE on gimp_osx_focus_window to avoid endless loop



commit 3e78c674d81ef0e64dba0a579c625b76004129f7
Author: Oleksii Samorukov <samm os2 kiev ua>
Date:   Wed Jan 15 17:40:23 2020 +0100

    Return FALSE on gimp_osx_focus_window to avoid endless loop

 app/tests.c      | 7 ++++---
 libgimp/gimpui.c | 9 +++++----
 2 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/app/tests.c b/app/tests.c
index f3329f0878..e71bcbee63 100644
--- a/app/tests.c
+++ b/app/tests.c
@@ -97,10 +97,11 @@ gimp_init_icon_theme_for_testing (void)
 }
 
 #ifdef GDK_WINDOWING_QUARTZ
-static void
-gimp_osx_focus_window (void)
+static gboolean
+gimp_osx_focus_window (gpointer user_data)
 {
   [NSApp activateIgnoringOtherApps:YES];
+  return FALSE;
 }
 #endif
 
@@ -142,7 +143,7 @@ gimp_init_for_gui_testing_internal (gboolean  show_gui,
   gimp_initialize (gimp, gimp_status_func_dummy);
   gimp_restore (gimp, gimp_status_func_dummy, NULL);
 #ifdef GDK_WINDOWING_QUARTZ
-  g_idle_add ((GSourceFunc) gimp_osx_focus_window, NULL);
+  g_idle_add (gimp_osx_focus_window, NULL);
 #endif
 
   return gimp;
diff --git a/libgimp/gimpui.c b/libgimp/gimpui.c
index 5febb0df5b..4bf31eaa4b 100644
--- a/libgimp/gimpui.c
+++ b/libgimp/gimpui.c
@@ -71,7 +71,7 @@ static gboolean  gimp_window_set_transient_for  (GtkWindow         *window,
                                                  GdkWindow         *parent);
 
 #ifdef GDK_WINDOWING_QUARTZ
-static void      gimp_osx_focus_window          (void);
+static gboolean  gimp_osx_focus_window          (gpointer);
 #endif
 
 
@@ -168,7 +168,7 @@ gimp_ui_init (const gchar *prog_name)
   gimp_dialogs_show_help_button (gimp_show_help_button ());
 
 #ifdef GDK_WINDOWING_QUARTZ
-  g_idle_add ((GSourceFunc) gimp_osx_focus_window, NULL);
+  g_idle_add (gimp_osx_focus_window, NULL);
 #endif
 
   gimp_ui_initialized = TRUE;
@@ -444,9 +444,10 @@ gimp_window_set_transient_for (GtkWindow *window,
 }
 
 #ifdef GDK_WINDOWING_QUARTZ
-static void
-gimp_osx_focus_window (void)
+static gboolean
+gimp_osx_focus_window (gpointer user_data)
 {
   [NSApp activateIgnoringOtherApps:YES];
+  return FALSE;
 }
 #endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]