From 17b40ca1487b2427598e8404af22d8b1fe83726d Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Mon, 28 Feb 2022 12:20:24 -0800 Subject: [PATCH] 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); } -- 2.30.2