mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-09 06:58:29 -04:00
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.
This commit is contained in:
@@ -217,7 +217,7 @@ Item {
|
|||||||
frozenMotionOffsetX = modalContainer ? modalContainer.offsetX : 0;
|
frozenMotionOffsetX = modalContainer ? modalContainer.offsetX : 0;
|
||||||
frozenMotionOffsetY = modalContainer ? modalContainer.offsetY : animationOffset;
|
frozenMotionOffsetY = modalContainer ? modalContainer.offsetY : animationOffset;
|
||||||
|
|
||||||
const focusedScreen = CompositorService.getFocusedScreen();
|
const focusedScreen = root.targetScreen ?? CompositorService.getFocusedScreen();
|
||||||
if (focusedScreen) {
|
if (focusedScreen) {
|
||||||
contentWindow.screen = focusedScreen;
|
contentWindow.screen = focusedScreen;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ Item {
|
|||||||
function open() {
|
function open() {
|
||||||
closeTimer.stop();
|
closeTimer.stop();
|
||||||
isClosing = false;
|
isClosing = false;
|
||||||
const focusedScreen = CompositorService.getFocusedScreen();
|
const focusedScreen = root.targetScreen ?? CompositorService.getFocusedScreen();
|
||||||
const screenChanged = focusedScreen && contentWindow.screen !== focusedScreen;
|
const screenChanged = focusedScreen && contentWindow.screen !== focusedScreen;
|
||||||
if (focusedScreen) {
|
if (focusedScreen) {
|
||||||
if (screenChanged)
|
if (screenChanged)
|
||||||
|
|||||||
Reference in New Issue
Block a user