summaryrefslogtreecommitdiff
path: root/bar/Workspace.qml
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-07-28 00:07:35 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-07-28 00:07:35 +0800
commit4c1c8afd643daac14e5692b7e0aff13f1ee4b181 (patch)
tree8d1467efe8f88deefc6be74fa2ca628a8762e2a6 /bar/Workspace.qml
parent2a0b49a58454a91cd4ad695643757dc4e80dfb0c (diff)
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
Diffstat (limited to 'bar/Workspace.qml')
-rw-r--r--bar/Workspace.qml8
1 files changed, 8 insertions, 0 deletions
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