From 4682787a5baa6094995bccc8190830a504a2385d Mon Sep 17 00:00:00 2001 From: Ahmed Alghali Date: Wed, 14 Oct 2026 11:22:19 +0300 Subject: [PATCH] Open on the current Space instead of jumping to another Activating the app jumps to a Space that holds one of its windows. Since Relaunch activated before ordering the grid in, the only candidate was the text-input helper window (TUINSWindow) AppKit creates for the search field, which stays on the Space Relaunch launched on. With many Spaces, pinching opened the grid there instead of where you were. Order the grid (which joins every Space) in first, then activate. --- Sources/Relaunch/AppDelegate.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sources/Relaunch/AppDelegate.swift b/Sources/Relaunch/AppDelegate.swift index be57957..45f29c8 100644 --- a/Sources/Relaunch/AppDelegate.swift +++ b/Sources/Relaunch/AppDelegate.swift @@ -137,8 +137,12 @@ final class AppDelegate: NSObject, NSApplicationDelegate { } NSApp.unhide(nil) - if #available(macOS 14, *) { NSApp.activate() } else { NSApp.activate(ignoringOtherApps: true) } + // Order the grid in before activating: activation jumps to a Space + // holding one of the app's windows, and until the grid (on every Space) + // is up, the only candidate is a text-input helper window on whichever + // Space Relaunch launched on. window.makeKeyAndOrderFront(nil) + if #available(macOS 14, *) { NSApp.activate() } else { NSApp.activate(ignoringOtherApps: true) } debugLog("show on \(screen.frame) visible=\(window.isVisible) key=\(window.isKeyWindow) active=\(NSApp.isActive)") }