From babe5086f3be25585d65f09e211d861fcfc45dfd Mon Sep 17 00:00:00 2001 From: Reuben Steenekamp Date: Wed, 18 Mar 2026 21:53:12 +0200 Subject: [PATCH] i3/workspace: Use name instead of id for activate --- changelog/next.md | 1 + src/x11/i3/ipc/workspace.cpp | 2 +- src/x11/i3/ipc/workspace.hpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/changelog/next.md b/changelog/next.md index a8981b98..db2b3e2f 100644 --- a/changelog/next.md +++ b/changelog/next.md @@ -61,6 +61,7 @@ set shell id. - Fixed partial socket reads in greetd and hyprland on slow machines. - Worked around Qt bug causing crashes when plugging and unplugging monitors. - Fixed HyprlandFocusGrab crashing if windows were destroyed after being passed to it. +- Fixed `I3Workspace.activate()` sending invalid commands to i3/sway for named or special workspaces. ## Packaging Changes diff --git a/src/x11/i3/ipc/workspace.cpp b/src/x11/i3/ipc/workspace.cpp index 03fadc26..5d276b4e 100644 --- a/src/x11/i3/ipc/workspace.cpp +++ b/src/x11/i3/ipc/workspace.cpp @@ -55,7 +55,7 @@ void I3Workspace::updateFromObject(const QVariantMap& obj) { } void I3Workspace::activate() { - this->ipc->dispatch(QString("workspace number %1").arg(this->bNumber.value())); + this->ipc->dispatch(QString("workspace %1").arg(this->bName.value())); } } // namespace qs::i3::ipc diff --git a/src/x11/i3/ipc/workspace.hpp b/src/x11/i3/ipc/workspace.hpp index f540545d..3da08f3f 100644 --- a/src/x11/i3/ipc/workspace.hpp +++ b/src/x11/i3/ipc/workspace.hpp @@ -47,7 +47,7 @@ class I3Workspace: public QObject { /// /// > [!NOTE] This is equivalent to running /// > ```qml - /// > I3.dispatch(`workspace number ${workspace.number}`); + /// > I3.dispatch(`workspace ${workspace.name}`); /// > ``` Q_INVOKABLE void activate();