Dynamic workspace rules not taking effect at runtime

Hi all

I am using dynamic workspace rules by matching the workspace names, example below

hl.workspace_rule({
    workspace = "n[s:coding-]",
    layout = "master",
})

function toggle_workspace_name(workspace, pref)
    local default_name = tostring(workspace.id)
    local target_name = pref .. default_name

    if workspace.name == target_name then
        target_name = default_name
    end
    hl.dispatch(hl.dsp.workspace.rename({
        workspace = default_name,
        name = target_name,
    }))
end

I have a custom keymap set for the toggle_workspace_name name which pre-ends or removes coding- (or something else) to the workspace name. At runtime the workspace name does get updated but the new layout does not take effect. Only upon executing hyprctl reload does the changes take effect. For workspace rules changing decorations, the rules only take effect when switching workspaces, creating new windows or resizing windows in the workspace. Is there any way to make these changes take effect upon executing my function?

Hyprland versions

hyprland -v
Hyprland 0.55.3 built from branch v0.55.3 at commit fe5fe79a29ac3adaf3e75560b2f4b7a6d58b31c9 clean ([gha] Nix: update inputs).
Date: Sun Jun 7 10:35:01 2026
Tag: v0.55.3, commits: 7366

Libraries:
Hyprgraphics: built against 0.5.1, system has 0.5.1
Hyprutils: built against 0.13.1, system has 0.13.1
Hyprcursor: built against 0.1.13, system has 0.1.13
Hyprlang: built against 0.6.8, system has 0.6.8
Aquamarine: built against 0.12.0, system has 0.12.0