[gimp] Fix plugin focus issues on osx
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Fix plugin focus issues on osx
- Date: Thu, 18 Oct 2018 12:07:53 +0000 (UTC)
commit ac26671eb60877995d27acd547f45d06b0480e5f
Author: Oleksii Samorukov <samm os2 kiev ua>
Date: Thu Oct 18 09:26:05 2018 +0200
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 3adf4a4861ba0641e64caaf6fd80a794da7687a9)
libgimp/gimpui.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
---
diff --git a/libgimp/gimpui.c b/libgimp/gimpui.c
index 1cea20246b..938925d5c1 100644
--- a/libgimp/gimpui.c
+++ b/libgimp/gimpui.c
@@ -63,6 +63,10 @@ static void gimp_window_transient_realized (GtkWidget *window,
static gboolean gimp_window_set_transient_for (GtkWindow *window,
GdkWindow *parent);
+#ifdef GDK_WINDOWING_QUARTZ
+static void gimp_osx_focus_window (void);
+#endif
+
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 ());
#ifdef GDK_WINDOWING_QUARTZ
- [NSApp activateIgnoringOtherApps:YES];
+ g_idle_add ((GSourceFunc) gimp_osx_focus_window, NULL);
#endif
gimp_ui_initialized = TRUE;
@@ -405,3 +409,11 @@ gimp_window_set_transient_for (GtkWindow *window,
return FALSE;
}
+
+#ifdef GDK_WINDOWING_QUARTZ
+static void
+gimp_osx_focus_window (void)
+{
+ [NSApp activateIgnoringOtherApps:YES];
+}
+#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]