Return FALSE on gimp_osx_focus_window to avoid endless loop

(cherry picked from commit 3e78c674d8)
This commit is contained in:
Oleksii Samorukov 2020-01-15 17:40:23 +01:00
parent 628833426a
commit df850fa394
2 changed files with 9 additions and 7 deletions

View file

@ -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;

View file

@ -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