[gimp/gimp-2-10] Fix plugin focus issues on osx GTK/OSX does not automatically assign focus to the new windows (upstr
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] Fix plugin focus issues on osx GTK/OSX does not automatically assign focus to the new windows (upstr
- Date: Thu, 18 Oct 2018 12:04:43 +0000 (UTC)
commit 3adf4a4861ba0641e64caaf6fd80a794da7687a9
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.
libgimp/gimpui.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/libgimp/gimpui.c b/libgimp/gimpui.c
index 54e04ee357..11bccd2e01 100644
--- a/libgimp/gimpui.c
+++ b/libgimp/gimpui.c
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]