1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-29 07:52:50 -05:00

popout: fix cross-monitor handling of widgets

fixes #1364
This commit is contained in:
bbedward
2026-01-16 09:34:08 -05:00
parent a57a9c2121
commit 1cf2f6b946

View File

@@ -82,15 +82,19 @@ Singleton {
popoutOpening(); popoutOpening();
} }
let justClosedSamePopout = false; let movedFromOtherScreen = false;
for (const otherScreenName in currentPopoutsByScreen) { for (const otherScreenName in currentPopoutsByScreen) {
if (otherScreenName === screenName) if (otherScreenName === screenName)
continue; continue;
const otherPopout = currentPopoutsByScreen[otherScreenName]; const otherPopout = currentPopoutsByScreen[otherScreenName];
if (!otherPopout) if (!otherPopout)
continue; continue;
if (otherPopout === popout) { if (otherPopout === popout) {
justClosedSamePopout = true; movedFromOtherScreen = true;
currentPopoutsByScreen[otherScreenName] = null;
currentPopoutTriggers[otherScreenName] = null;
continue;
} }
if (otherPopout.dashVisible !== undefined) { if (otherPopout.dashVisible !== undefined) {
@@ -112,7 +116,7 @@ Singleton {
} }
} }
if (currentPopout === popout && popout.shouldBeVisible) { if (currentPopout === popout && popout.shouldBeVisible && !movedFromOtherScreen) {
if (triggerId !== undefined && currentPopoutTriggers[screenName] === triggerId) { if (triggerId !== undefined && currentPopoutTriggers[screenName] === triggerId) {
if (popout.dashVisible !== undefined) { if (popout.dashVisible !== undefined) {
popout.dashVisible = false; popout.dashVisible = false;
@@ -139,6 +143,7 @@ Singleton {
popout.currentTabIndex = tabIndex; popout.currentTabIndex = tabIndex;
} }
currentPopoutTriggers[screenName] = triggerId; currentPopoutTriggers[screenName] = triggerId;
return;
} }
currentPopoutTriggers[screenName] = triggerId; currentPopoutTriggers[screenName] = triggerId;
@@ -153,16 +158,8 @@ Singleton {
ModalManager.closeAllModalsExcept(null); ModalManager.closeAllModalsExcept(null);
} }
if (justClosedSamePopout) { if (movedFromOtherScreen) {
Qt.callLater(() => { popout.open();
if (popout.dashVisible !== undefined) {
popout.dashVisible = true;
} else if (popout.notificationHistoryVisible !== undefined) {
popout.notificationHistoryVisible = true;
} else {
popout.open();
}
});
} else { } else {
if (popout.dashVisible !== undefined) { if (popout.dashVisible !== undefined) {
popout.dashVisible = true; popout.dashVisible = true;