1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-05 21:15:38 -05:00

fix some stale screen ref issues in OSD and popout

This commit is contained in:
bbedward
2025-12-05 13:31:57 -05:00
parent 2c48458384
commit 1f00b5f577
2 changed files with 20 additions and 2 deletions

View File

@@ -16,7 +16,15 @@ Singleton {
const currentOSD = currentOSDsByScreen[screenName]; const currentOSD = currentOSDsByScreen[screenName];
if (currentOSD && currentOSD !== osd) { if (currentOSD && currentOSD !== osd) {
currentOSD.hide(); if (typeof currentOSD.hide === "function") {
try {
currentOSD.hide();
} catch (e) {
currentOSDsByScreen[screenName] = null;
}
} else {
currentOSDsByScreen[screenName] = null;
}
} }
currentOSDsByScreen[screenName] = osd; currentOSDsByScreen[screenName] = osd;

View File

@@ -68,6 +68,8 @@ Item {
signal popoutClosed signal popoutClosed
signal backgroundClicked signal backgroundClicked
property var _lastOpenedScreen: null
property int effectiveBarPosition: 0 property int effectiveBarPosition: 0
property real effectiveBarBottomGap: 0 property real effectiveBarBottomGap: 0
@@ -100,9 +102,17 @@ Item {
if (!screen) if (!screen)
return; return;
closeTimer.stop(); closeTimer.stop();
if (_lastOpenedScreen !== null && _lastOpenedScreen !== screen) {
contentWindow.visible = false;
if (useBackgroundWindow)
backgroundWindow.visible = false;
}
_lastOpenedScreen = screen;
shouldBeVisible = true; shouldBeVisible = true;
Qt.callLater(() => { Qt.callLater(() => {
if (shouldBeVisible) { if (shouldBeVisible && screen) {
if (useBackgroundWindow) if (useBackgroundWindow)
backgroundWindow.visible = true; backgroundWindow.visible = true;
contentWindow.visible = true; contentWindow.visible = true;