[gtk/wip/chergert/for-4-6: 23/56] macos: start application in foreground




commit 17b40ca1487b2427598e8404af22d8b1fe83726d
Author: Christian Hergert <christian hergert me>
Date:   Mon Feb 28 12:20:24 2022 -0800

    macos: start application in foreground
    
    We need to bring the application to the foreground in multiple ways, and
    this call to [NSApp activateIgnoringOtherApps:YES] ensures that we become
    foreground before the first window is opened. Otherwise we end up starting
    applications in the background.
    
    Fixes #4736

 gdk/macos/gdkmacosdisplay.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/gdk/macos/gdkmacosdisplay.c b/gdk/macos/gdkmacosdisplay.c
index cb0331419d..ddcc274372 100644
--- a/gdk/macos/gdkmacosdisplay.c
+++ b/gdk/macos/gdkmacosdisplay.c
@@ -684,6 +684,8 @@ _gdk_macos_display_open (const char *display_name)
 
   gdk_display_emit_opened (GDK_DISPLAY (self));
 
+  [NSApp activateIgnoringOtherApps:YES];
+
   return GDK_DISPLAY (self);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]