From c78e7e386ab67947c051c2b26a32760318c79d11 Mon Sep 17 00:00:00 2001 From: Lemmy Date: Sat, 21 Mar 2026 08:41:42 -0400 Subject: [PATCH] Revert "fix(OSD): keep panelwindow always loaded to avoid hotplug crash" This reverts commit 3b5410103a6958cd4fdb1793bca2ad0ef16bf524. --- Modules/OSD/OSD.qml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Modules/OSD/OSD.qml b/Modules/OSD/OSD.qml index 74010c6f3..145434a0c 100644 --- a/Modules/OSD/OSD.qml +++ b/Modules/OSD/OSD.qml @@ -29,9 +29,7 @@ Variants { required property ShellScreen modelData - // Keep PanelWindow always loaded to avoid creating Wayland surfaces during - // monitor hotplug, which races with wl_output teardown and crashes. - active: true + active: false // OSD State property int currentOSDType: -1 // OSD.Type enum value, -1 means none @@ -232,14 +230,25 @@ Variants { currentOSDType = type; + if (!root.active) { + root.active = true; + } + if (root.item) { root.item.showOSD(); + } else { + Qt.callLater(() => { + if (root.item) + root.item.showOSD(); + }); } } function hideOSD() { if (root.item?.osdItem) { root.item.osdItem.hideImmediately(); + } else if (root.active) { + root.active = false; } } @@ -515,9 +524,6 @@ Variants { implicitHeight: verticalMode ? (isShortMode ? lockKeyVHeight : longVHeight) : longHHeight color: "transparent" - // Click-through — OSD is display-only, no input needed - mask: Region {} - WlrLayershell.namespace: "noctalia-osd-" + (screen?.name || "unknown") WlrLayershell.keyboardFocus: WlrKeyboardFocus.None WlrLayershell.layer: Settings.data.osd?.overlayLayer ? WlrLayer.Overlay : WlrLayer.Top @@ -557,6 +563,7 @@ Variants { osdItem.visible = false; root.currentOSDType = -1; root.lastLockKeyChanged = ""; + root.active = false; } } @@ -846,6 +853,7 @@ Variants { osdItem.scale = 0.85; osdItem.visible = false; root.currentOSDType = -1; + root.active = false; } }