From 044cd2c49f78917ca6cbac4d89bcb78e486425bf Mon Sep 17 00:00:00 2001 From: mlpotter Date: Thu, 21 May 2026 19:34:18 -0700 Subject: [PATCH] i3/ipc: Use workspace id to handle rename event When a rename event comes in, the value of data.current.name is the NEW name value so it can't be used to find the existing workspace data which still has the old value. --- src/x11/i3/ipc/controller.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/x11/i3/ipc/controller.cpp b/src/x11/i3/ipc/controller.cpp index e4f32ff9..80a4b157 100644 --- a/src/x11/i3/ipc/controller.cpp +++ b/src/x11/i3/ipc/controller.cpp @@ -291,7 +291,19 @@ void I3IpcController::handleWorkspaceEvent(I3IpcEvent* event) { } else { qCInfo(logI3Ipc) << "Workspace" << name << "has already been deleted"; } - } else if (change == "move" || change == "rename" || change == "urgent") { + } else if (change == "rename") { + auto id = event->mData["current"]["id"].toInt(-1); + + auto* workspace = this->findWorkspaceByID(id); + + if (workspace != nullptr) { + auto data = event->mData["current"].toObject().toVariantMap(); + + workspace->updateFromObject(data); + } else { + qCWarning(logI3Ipc) << "Workspace with id" << id << "doesn't exist"; + } + } else if (change == "move" || change == "urgent") { auto name = event->mData["current"]["name"].toString(); auto* workspace = this->findWorkspaceByName(name);