Commit 3adf4a48 authored by Alex Samorukov's avatar Alex Samorukov

Fix plugin focus issues on osx

GTK/OSX does not automatically assign focus to the new windows (upstream 
issue), so activateIgnoringOtherApps is called. However, if it is called 
before gtk initialized it may cause number of focus issues.
parent ee05ada0
......@@ -80,7 +80,9 @@ static void gimp_ui_draw_pixbuf_layout (GtkStyle *style,
gint x,
gint y,
PangoLayout *layout);
#ifdef GDK_WINDOWING_QUARTZ
static void gimp_osx_focus_window (void);
#endif
static gboolean gimp_ui_initialized = FALSE;
......@@ -182,7 +184,7 @@ gimp_ui_init (const gchar *prog_name,
gimp_dialogs_show_help_button (gimp_show_help_button ());
#ifdef GDK_WINDOWING_QUARTZ
[NSApp activateIgnoringOtherApps:YES];
g_idle_add ((GSourceFunc) gimp_osx_focus_window, NULL);
#endif
gimp_ui_fix_pixbuf_style ();
......@@ -492,3 +494,11 @@ gimp_ui_draw_pixbuf_layout (GtkStyle *style,
if (area)
gdk_gc_set_clip_rectangle (gc, NULL);
}
#ifdef GDK_WINDOWING_QUARTZ
static void
gimp_osx_focus_window (void)
{
[NSApp activateIgnoringOtherApps:YES];
}
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment