From 660953ebc53c757f3ed921cbbe0291bdb30476d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=E1=BB=B3nh=20Thi=E1=BB=87n=20L=E1=BB=99c?= Date: Tue, 14 Jul 2026 19:42:08 +0700 Subject: [PATCH] fix(Modal): respect targetScreen property instead of always using focused screen (#2861) The open() method in both DankModalStandalone and DankModalConnected unconditionally set contentWindow.screen to the focused screen, ignoring the targetScreen property. Fix: use root.targetScreen ?? CompositorService.getFocusedScreen() so the modal appears on the configured screen when set, and falls back to focused screen otherwise. (cherry picked from commit f1e9121295b823003388b965e308cad6ff9e4b00) --- quickshell/Modals/Common/DankModalConnected.qml | 2 +- quickshell/Modals/Common/DankModalStandalone.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/quickshell/Modals/Common/DankModalConnected.qml b/quickshell/Modals/Common/DankModalConnected.qml index 4ee2370f7..238002b6a 100644 --- a/quickshell/Modals/Common/DankModalConnected.qml +++ b/quickshell/Modals/Common/DankModalConnected.qml @@ -217,7 +217,7 @@ Item { frozenMotionOffsetX = modalContainer ? modalContainer.offsetX : 0; frozenMotionOffsetY = modalContainer ? modalContainer.offsetY : animationOffset; - const focusedScreen = CompositorService.getFocusedScreen(); + const focusedScreen = root.targetScreen ?? CompositorService.getFocusedScreen(); if (focusedScreen) { contentWindow.screen = focusedScreen; } diff --git a/quickshell/Modals/Common/DankModalStandalone.qml b/quickshell/Modals/Common/DankModalStandalone.qml index a46a611c5..24f3fa0ce 100644 --- a/quickshell/Modals/Common/DankModalStandalone.qml +++ b/quickshell/Modals/Common/DankModalStandalone.qml @@ -70,7 +70,7 @@ Item { function open() { closeTimer.stop(); isClosing = false; - const focusedScreen = CompositorService.getFocusedScreen(); + const focusedScreen = root.targetScreen ?? CompositorService.getFocusedScreen(); const screenChanged = focusedScreen && contentWindow.screen !== focusedScreen; if (focusedScreen) { if (screenChanged)