From 4c1c8afd643daac14e5692b7e0aff13f1ee4b181 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Mon, 28 Jul 2025 00:07:35 +0800 Subject: ws: fixed a issue where if you close the last pinned window, the workspace activerect won't react tradeoff: monitor and updates activeoccupied whenever toplevel changes --- bar/Workspace.qml | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'bar') diff --git a/bar/Workspace.qml b/bar/Workspace.qml index ee6810b..f78cf1d 100644 --- a/bar/Workspace.qml +++ b/bar/Workspace.qml @@ -13,6 +13,8 @@ Item { implicitWidth: layout.implicitWidth property var ws: Hyprland.workspaces + property var toplevels: Hyprland.toplevels.values // update activeOccupied when toplevels changes as getWorkspaceStat's return is non reactive + property int activeIndex: -1 property bool activeOccupied: false property bool toChild: false @@ -32,6 +34,12 @@ Item { }; } + onToplevelsChanged: { + Qt.callLater(() => { + activeOccupied = getWorkspaceStats(activeIndex).isOccupied || false; + }); + } + DropShadow { anchors.fill: activeRect source: activeRect -- cgit v1.2.3