#5352·Waybar

hyprland/workspaces: changeworkspaceid leaves {name} stale (wrong labels, double-active)

Author: jaehhoCreated Sep 28, 2026Updated Sep 28, 2026
Labelsbughyprlandcustomclock

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:

  1. "format": "{name}" (and {name} {windows}) shows the old number after a renumber.
  2. updateWorkspaceStates marks a workspace active if id == m_activeWorkspaceId or name == currentWorkspaceName. A stale name that happens to match the current workspace produces a second .active pill.
  3. Named-workspace clicks (IPC::dispatch(..., "name:" + name())) would also go to the wrong target; numeric clicks use id() so those still work.

Reproduction

Hyprland v0.56.2, waybar 16843896, one monitor, format "{name} {windows}".

bash
# 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) ... Steno

Waybar 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,3

A 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_id is rejected for managed/named workspaces (cannot change id of workspace with a managed id), so every ID change is a numeric workspace whose name becomes to_string(new_id).
  • #5347 / #4680 address the double-active symptom via an active-by option; this issue is the missing name update on the ID-change path, which still leaves wrong {name} labels even with active-by: id.
  • Introduced with #5248.