macos: start application in foreground
authorChristian Hergert <christian@hergert.me>
Mon, 28 Feb 2022 20:20:24 +0000 (12:20 -0800)
committerChristian Hergert <chergert@redhat.com>
Wed, 16 Mar 2022 19:24:11 +0000 (12:24 -0700)
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

index cb0331419d7d0ceabe4086f2183f86790ce99988..ddcc27437256285f20b8ec7805682dd7b33731ce 100644 (file)
@@ -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);
 }