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];
|
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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user