[gtk/wip/chergert/for-main] macos: start application in foreground
- From: Christian Hergert <chergert src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [gtk/wip/chergert/for-main] macos: start application in foreground
 
- Date: Mon, 28 Feb 2022 20:20:44 +0000 (UTC)
 
commit 66284cd24547a8adc56ca3d24558b83465bd7986
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]