summaryrefslogtreecommitdiff
path: root/modules/bar
diff options
context:
space:
mode:
Diffstat (limited to 'modules/bar')
-rw-r--r--modules/bar/Bar.qml9
-rw-r--r--modules/bar/components/workspaces/SpecialWorkspaces.qml9
2 files changed, 13 insertions, 5 deletions
diff --git a/modules/bar/Bar.qml b/modules/bar/Bar.qml
index 58a30d1..09cebee 100644
--- a/modules/bar/Bar.qml
+++ b/modules/bar/Bar.qml
@@ -56,10 +56,11 @@ ColumnLayout {
const ch = childAt(width / 2, y) as WrappedLoader;
if (ch?.id === "workspaces") {
// Workspace scroll
- const activeWs = Hyprland.activeToplevel?.workspace?.name;
- if (activeWs?.startsWith("special:"))
- Hyprland.dispatch(`togglespecialworkspace ${activeWs.slice(8)}`);
- else if (angleDelta.y < 0 || Hyprland.activeWsId > 1)
+ const mon = (Config.bar.workspaces.perMonitorWorkspaces ? Hyprland.monitorFor(screen) : Hyprland.focusedMonitor);
+ const specialWs = mon?.lastIpcObject.specialWorkspace.name;
+ if (specialWs?.length > 0)
+ Hyprland.dispatch(`togglespecialworkspace ${specialWs.slice(8)}`);
+ else if (angleDelta.y < 0 || (Config.bar.workspaces.perMonitorWorkspaces ? mon.activeWorkspace?.id : Hyprland.activeWsId) > 1)
Hyprland.dispatch(`workspace r${angleDelta.y > 0 ? "-" : "+"}1`);
} else if (y < screen.height / 2) {
// Volume scroll on top half
diff --git a/modules/bar/components/workspaces/SpecialWorkspaces.qml b/modules/bar/components/workspaces/SpecialWorkspaces.qml
index 7ed4515..fb31257 100644
--- a/modules/bar/components/workspaces/SpecialWorkspaces.qml
+++ b/modules/bar/components/workspaces/SpecialWorkspaces.qml
@@ -120,6 +120,7 @@ Item {
required property HyprlandWorkspace modelData
readonly property int size: label.Layout.preferredHeight + (hasWindows ? windows.implicitHeight + Appearance.padding.small : 0)
+ property int wsId
property string icon
property bool hasWindows
@@ -129,6 +130,7 @@ Item {
spacing: 0
Component.onCompleted: {
+ wsId = modelData.id;
icon = Icons.getSpecialWsIcon(modelData.name);
hasWindows = Config.bar.workspaces.showWindows && modelData.lastIpcObject.windows > 0;
}
@@ -137,6 +139,11 @@ Item {
Connections {
target: ws.modelData
+ function onIdChanged(): void {
+ if (ws.modelData)
+ ws.wsId = ws.modelData.id;
+ }
+
function onNameChanged(): void {
if (ws.modelData)
ws.icon = Icons.getSpecialWsIcon(ws.modelData.name);
@@ -222,7 +229,7 @@ Item {
Repeater {
model: ScriptModel {
- values: Hyprland.toplevels.values.filter(c => c.workspace?.id === ws.modelData.id)
+ values: Hyprland.toplevels.values.filter(c => c.workspace?.id === ws.wsId)
}
MaterialIcon {