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:
@@ -16,7 +16,15 @@ Singleton {
|
||||
const currentOSD = currentOSDsByScreen[screenName];
|
||||
|
||||
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;
|
||||
|
||||
@@ -68,6 +68,8 @@ Item {
|
||||
signal popoutClosed
|
||||
signal backgroundClicked
|
||||
|
||||
property var _lastOpenedScreen: null
|
||||
|
||||
property int effectiveBarPosition: 0
|
||||
property real effectiveBarBottomGap: 0
|
||||
|
||||
@@ -100,9 +102,17 @@ Item {
|
||||
if (!screen)
|
||||
return;
|
||||
closeTimer.stop();
|
||||
|
||||
if (_lastOpenedScreen !== null && _lastOpenedScreen !== screen) {
|
||||
contentWindow.visible = false;
|
||||
if (useBackgroundWindow)
|
||||
backgroundWindow.visible = false;
|
||||
}
|
||||
_lastOpenedScreen = screen;
|
||||
|
||||
shouldBeVisible = true;
|
||||
Qt.callLater(() => {
|
||||
if (shouldBeVisible) {
|
||||
if (shouldBeVisible && screen) {
|
||||
if (useBackgroundWindow)
|
||||
backgroundWindow.visible = true;
|
||||
contentWindow.visible = true;
|
||||
|
||||
Reference in New Issue
Block a user