hyprland/workspaces: changeworkspaceid leaves {name} stale (wrong labels, double-active)
Description
When Hyprland renumbers a workspace (changeworkspaceid / workspace.change_id), it also renames the workspace to tostring(new_id) for numeric workspaces — but it does not emit renameworkspace.
Waybar's handler (Workspaces::onWorkspaceIdChanged, from #5248) updates only m_id. m_name keeps the old value, so:
"format": "{name}"(and{name} {windows}) shows the old number after a renumber.updateWorkspaceStatesmarks a workspace active ifid == m_activeWorkspaceIdorname == currentWorkspaceName. A stale name that happens to match the current workspace produces a second.activepill.- Named-workspace clicks (
IPC::dispatch(..., "name:" + name())) would also go to the wrong target; numeric clicks useid()so those still work.
Reproduction
Hyprland v0.56.2, waybar 16843896, one monitor, format "{name} {windows}".
# workspaces 3 and 4 hold windows; destroy workspace 2 so ids should pack
hyprctl dispatch 'hl.dsp.workspace.change_id({ workspace = 3, id = 2 })'
hyprctl dispatch 'hl.dsp.workspace.change_id({ workspace = 4, id = 3 })'Hyprland IPC after this (hyprctl workspaces):
workspace ID 2 (2) ... Zotero
workspace ID 3 (3) ... StenoWaybar still shows buttons labeled 3 and 4. On Steno (name "3", id 3) both the stale "3" button and the real "3" button get .active.
Event log confirms no renameworkspace is emitted:
changeworkspaceid>>3,2
changeworkspaceid>>4,3A same-name renameworkspace is enough to heal a running bar (renameworkspace>>2,2 → onWorkspaceRenamed), which is how this was worked around outside Waybar.
Expected
After changeworkspaceid, {name} and active detection match Hyprland.
Notes
change_idis rejected for managed/named workspaces (cannot change id of workspace with a managed id), so every ID change is a numeric workspace whose name becomesto_string(new_id).- #5347 / #4680 address the double-active symptom via an
active-byoption; this issue is the missing name update on the ID-change path, which still leaves wrong{name}labels even withactive-by: id. - Introduced with #5248.
Source: Alexays/Waybar