Commit ac26671e authored by Alex Samorukov's avatar Alex Samorukov Committed by Michael Natterer

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.

(cherry picked from commit 3adf4a48)
parent 0102ebe0
......@@ -63,6 +63,10 @@ static void gimp_window_transient_realized (GtkWidget *window,
static gboolean gimp_window_set_transient_for (GtkWindow *window,
GdkWindow *parent);
static void gimp_osx_focus_window (void);
static gboolean gimp_ui_initialized = FALSE;
......@@ -177,7 +181,7 @@ gimp_ui_init (const gchar *prog_name,
gimp_dialogs_show_help_button (gimp_show_help_button ());
[NSApp activateIgnoringOtherApps:YES];
g_idle_add ((GSourceFunc) gimp_osx_focus_window, NULL);
gimp_ui_initialized = TRUE;
......@@ -405,3 +409,11 @@ gimp_window_set_transient_for (GtkWindow *window,
return FALSE;
static void
gimp_osx_focus_window (void)
[NSApp activateIgnoringOtherApps:YES];
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