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 f1e9121295)
This commit is contained in:
Huỳnh Thiện Lộc authored and dms-ci[bot] committed 2026-07-14 12:42:38 +00:00
1 parent bd70a6286e
commit 660953ebc5
2 files changed
+2 -2

No files matched your search

@@ -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;
}
@@ -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)