From 581faaae85226ef2e823f4a9d3089dc6a82af3f6 Mon Sep 17 00:00:00 2001 From: Aleksandra Olemskaia Date: Mon, 13 Jul 2026 20:04:39 +0200 Subject: [PATCH] [settings] IJPL-250151 bring IDE frame to front when opening pinned settings from a detached tab on macOS The pinned Settings dialog lives on the IDE's Space. When invoked via Cmd+, from a detached editor tab (its own Space), macOS stayed on the detached tab's Space after the dialog appeared, requiring Cmd+Tab to find it. Fix: call getIdeJFrame()?.toFront() before showing the FloatDialog so macOS navigates to the IDE Space first. (cherry picked from commit 3348469fafbd7731ce7cf4a98ef6923ce8aca89b) IJ-CR-217470 GitOrigin-RevId: 62e04a13067ab97a9efc44defbbf4e08a6e03e1a --- .../src/com/intellij/openapi/ui/NonModalWindowWrapper.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/platform/platform-impl/src/com/intellij/openapi/ui/NonModalWindowWrapper.kt b/platform/platform-impl/src/com/intellij/openapi/ui/NonModalWindowWrapper.kt index 36da9c8f1837..a81cedc96974 100644 --- a/platform/platform-impl/src/com/intellij/openapi/ui/NonModalWindowWrapper.kt +++ b/platform/platform-impl/src/com/intellij/openapi/ui/NonModalWindowWrapper.kt @@ -624,6 +624,13 @@ abstract class NonModalWindowWrapper( activeWindow.requestFocus() return } + // On macOS, a FloatDialog is owned by the IDE JFrame and lives on the IDE's Space. + // If the user invokes Settings from a detached editor tab (its own Space), macOS keeps + // focus on the detached tab's Space after the dialog becomes visible. Bringing the IDE + // frame to front first navigates macOS to the IDE Space before the dialog appears. + if (activeWindow is FloatDialog) { + getIdeJFrame()?.toFront() + } activeWindow.isVisible = true getPreferredFocusComponent()?.requestFocusInWindow() onShown()