1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-14 01:32:29 -04:00

popout: avoid calling close on bad reference

This commit is contained in:
bbedward
2026-03-23 09:40:53 -04:00
parent 5cad89e9cc
commit 43b2e5315d
2 changed files with 21 additions and 10 deletions

View File

@@ -13,7 +13,7 @@ func NewManager(display wlclient.WaylandDisplay) (*Manager, error) {
m := &Manager{ m := &Manager{
display: display, display: display,
ctx: display.Context(), ctx: display.Context(),
cmdq: make(chan cmd, 128), cmdq: make(chan cmd, 512),
stopChan: make(chan struct{}), stopChan: make(chan struct{}),
dirty: make(chan struct{}, 1), dirty: make(chan struct{}, 1),
fatalError: make(chan error, 1), fatalError: make(chan error, 1),

View File

@@ -1,4 +1,5 @@
pragma Singleton pragma Singleton
pragma ComponentBehavior: Bound
import Quickshell import Quickshell
import QtQuick import QtQuick
@@ -13,6 +14,7 @@ Singleton {
signal popoutChanged signal popoutChanged
function _closePopout(popout) { function _closePopout(popout) {
try {
switch (true) { switch (true) {
case popout.dashVisible !== undefined: case popout.dashVisible !== undefined:
popout.dashVisible = false; popout.dashVisible = false;
@@ -21,13 +23,22 @@ Singleton {
popout.notificationHistoryVisible = false; popout.notificationHistoryVisible = false;
return; return;
default: default:
if (typeof popout.close !== "function")
return;
popout.close(); popout.close();
} }
} catch (e) {
return;
}
} }
function _isStale(popout) { function _isStale(popout) {
try { try {
return !popout || !("shouldBeVisible" in popout); if (!popout || !("shouldBeVisible" in popout))
return true;
if (!popout.screen)
return true;
return false;
} catch (e) { } catch (e) {
return true; return true;
} }