#16114

Floating workspace mode floats, resizes and claims the first window that a float rule in the user's hyprland.lua should leave alone

OpenuBruckhausopened 1d ago

System details

AMD Ryzen 9 7950X3D, AMD Radeon RX 7900 XT, Omarchy 4.5.0rc1 (rc channel), Hyprland 0.56.2

What's wrong?

On a floating workspace (Super + L), the first window that opens after a config load ignores the user's own float rules from ~/.config/hypr/hyprland.lua. The floating mode resizes it to its default size, centres it and claims it (omarchy-mode-floated) as if it had been tiled. Later windows matching the same rule are handled correctly.

Cause: load order. The stock config/hypr/hyprland.lua loads default.hypr.toggles on line 26, which loads the saved workspace modes (default/hypr/workspace-layouts.lua → o.workspace_mode → sync_open_rules(), then workspace_modes.apply()). The template then says "Add any other personal Hyprland configuration below" (line 28). o.window rules placed there add their patterns to o.floating_apps only after sync_open_rules() has built the negative: match in not_floating_on_their_own() (default/hypr/workspace-modes.lua). So the open rule still floats/resizes/claims those windows. The patterns only take effect at the next sync_open_rules(), which runs in claim_opened() once the mode has claimed a window, so the second matching window is left alone.

A claimed window is also tiled again by tile_for_mode() when the workspace stops floating, even though the user's rule floats it.

Repro (the rule below sat after line 28 of ~/.config/hypr/hyprland.lua; any o.window(…, { float = true }) there should do):

o.window({ title = "^Video Trans — Live captions$" }, { float = true, pin = false, border_size = 0, opacity = "1 1" })
  1. Give an empty workspace the floating mode and load the config fresh, e.g. on workspace 6: printf '%s\n' 'o.workspace_mode({ workspace = "6", mode = "floating" })' > ~/.local/state/omarchy/workspace-layouts/6.lua && hyprctl reload
  2. On workspace 6, open two windows matching the rule, one after the other: foot -T 'Video Trans — Live captions' --app-id=repro-first -W 100x8 -e sleep 60 & foot -T 'Video Trans — Live captions' --app-id=repro-second -W 100x8 -e sleep 60 &
  3. hyprctl clients -j | jq -c '.[]|select(.class|test("^repro-"))|{class,size,tags}'

Result:

{"class":"repro-first","size":[1100,734],"tags":["omarchy-floating-workspace","omarchy-mode-floated","omarchy-mode-opened*"]}
{"class":"repro-second","size":[928,184],"tags":["omarchy-floating-workspace"]}

Expected: both like repro-second: own size, not claimed.

Rules in the hypr/*.lua files required before default.hypr.toggles (bindings, looknfeel, …) are not affected.

Possible fix: let workspace-modes.lua rebuild the open rules whenever o.window registers a new float pattern after the modes are set up, e.g. o.window in helpers.lua calls a hook (if o.floating_apps_changed then o.floating_apps_changed() end) that workspace-modes.lua sets to sync_open_rules. Alternatively run sync_open_rules() once more at the very end of the config load.

Activity

0

No activity yet.