From: Christian Hergert Date: Mon, 28 Feb 2022 20:20:24 +0000 (-0800) Subject: macos: start application in foreground X-Git-Tag: archive/raspbian/4.6.5+ds-1+rpi1~1^2~19^2~3^2~7^2~33 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=17b40ca1487b2427598e8404af22d8b1fe83726d;p=gtk4.git 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 --- 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); }