[gimp/gimp-2-10] Return FALSE on gimp_osx_focus_window to avoid endless loop



commit df850fa3947f1f911160503ad48eee182f9c262c
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
    
    (cherry picked from commit 3e78c674d81ef0e64dba0a579c625b76004129f7)

 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 b41a9d88ef..04c316a6a1 100644
--- a/libgimp/gimpui.c
+++ b/libgimp/gimpui.c
@@ -81,7 +81,7 @@ static void      gimp_ui_draw_pixbuf_layout     (GtkStyle      *style,
                                                  gint           y,
                                                  PangoLayout   *layout);
 #ifdef GDK_WINDOWING_QUARTZ
-static void      gimp_osx_focus_window           (void);
+static gboolean  gimp_osx_focus_window          (gpointer);
 #endif
 
 static gboolean gimp_ui_initialized = FALSE;
@@ -184,7 +184,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_fix_pixbuf_style ();
@@ -496,9 +496,10 @@ gimp_ui_draw_pixbuf_layout (GtkStyle      *style,
 }
 
 #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]