From 43b2e5315dfc950c95f73eede89160de6579897f Mon Sep 17 00:00:00 2001 From: bbedward Date: Mon, 23 Mar 2026 09:40:53 -0400 Subject: [PATCH] popout: avoid calling close on bad reference --- core/internal/server/wlroutput/manager.go | 2 +- quickshell/Common/PopoutManager.qml | 29 ++++++++++++++++------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/core/internal/server/wlroutput/manager.go b/core/internal/server/wlroutput/manager.go index 43ec0240..cbd89a38 100644 --- a/core/internal/server/wlroutput/manager.go +++ b/core/internal/server/wlroutput/manager.go @@ -13,7 +13,7 @@ func NewManager(display wlclient.WaylandDisplay) (*Manager, error) { m := &Manager{ display: display, ctx: display.Context(), - cmdq: make(chan cmd, 128), + cmdq: make(chan cmd, 512), stopChan: make(chan struct{}), dirty: make(chan struct{}, 1), fatalError: make(chan error, 1), diff --git a/quickshell/Common/PopoutManager.qml b/quickshell/Common/PopoutManager.qml index 961eb81f..47b4edad 100644 --- a/quickshell/Common/PopoutManager.qml +++ b/quickshell/Common/PopoutManager.qml @@ -1,4 +1,5 @@ pragma Singleton +pragma ComponentBehavior: Bound import Quickshell import QtQuick @@ -13,21 +14,31 @@ Singleton { signal popoutChanged function _closePopout(popout) { - switch (true) { - case popout.dashVisible !== undefined: - popout.dashVisible = false; + try { + switch (true) { + case popout.dashVisible !== undefined: + popout.dashVisible = false; + return; + case popout.notificationHistoryVisible !== undefined: + popout.notificationHistoryVisible = false; + return; + default: + if (typeof popout.close !== "function") + return; + popout.close(); + } + } catch (e) { return; - case popout.notificationHistoryVisible !== undefined: - popout.notificationHistoryVisible = false; - return; - default: - popout.close(); } } function _isStale(popout) { try { - return !popout || !("shouldBeVisible" in popout); + if (!popout || !("shouldBeVisible" in popout)) + return true; + if (!popout.screen) + return true; + return false; } catch (e) { return true; }