Skip to content

Memory of dock layouts has seriously regressed #5230

Done

Description

@alerque

My report in #3740 was closed without waiting for human review, even after the comments suggested that's what should happen next. It's possible that exact bug is fixed, but even in trying to test it things are still going sideways with the dock layouts.

I've now rebuild and installed (now at version 1.0.1beta.20261118.r54.gd8f5045-1 so d8f5045 compiled via the AUR VCS package) and the situation is much worse.

First, when I opened OBS had no docks at all. None. Not only did it not remember my layout but the layout was all gone. Only the preview/program panes were still around.

Then I started enabling docks from the view menu, but they didn't seem to have any remembered locations at all, so I figured something changed about how docks were being saved in user preferences at all. So I used the "reset docks" option to just blow them away and hopefully get a clean slate. Well it did get me a clean slate with default dock positions. But now I'm stuck there. None of the docks could be moved.

I am aware of the 'lock docks' setting in the view menu, but that was not checked, and no amount of checking and unchecking it seemed to have any effect.

I ended up blowing away the OBS settings directory entirely, then importing my profile(s) and scene collection(s). Thankfully I had those separately saved.

Now I seem to be able to layout docks and for the moment they are coming back when I restart. I'll report if I can duplicate the same behavior again, but something is amiss with using old settings in a current build. If there was a known breakage that's fine. I don't always expect backwards compatibility during development cycles. But at the same time I've followed the PR merge history pretty closely and hadn't seen anything to suggest that updating might have been a problem.

Activity

  1. vpacher commented on Nov 19, 2026

    @vpacher
    Member

    Thanks for the report, and sorry: this is a regression from my fix for #3740 (#4841). I can reproduce two of the three problems you describe.

    #4841 puts the dock layout of the start back each time the window changes size, until you change a dock. It sees a change only when the window keeps its size. On a tiling window manager, a dock change and a window resize often come together (for example, a dock that you drag out of the window becomes a new window, and the compositor can retile). Then:

    • Docks cannot be moved: the change comes with a resize, so OBS puts the start layout back. Every later move is undone the same way.
    • Reset Docks does not stay: OBS sees the reset as a resize too, and puts the old layout back. At quit, OBS saves the old layout, so the next start brings the problem back. This also explains why only a new settings folder fixed it: with no saved layout, the restore is off.

    A Qt test shows both: a floated dock and a reset layout are undone when the window is resized at the same time. With the dock helper from before #4841, both tests pass. These tests run under Xvfb; I have not run them on Hyprland.

    I cannot yet explain the first problem (no docks at all at the first start). Do you have a copy of the old user.ini or the log of that start? Either would help me find it.

    The fix I plan: OBS compares where the docks are (area, floating, hidden, tabs), not their sizes, so a change that comes with a resize stops the restore, and Reset Docks also stops it. I will open a PR with the tests, and leave this issue open until you confirm it on Hyprland.

  2. vpacher commented on Nov 19, 2026

    @vpacher
    Member

    Claiming: #5230 (the regression from my #4841, see my comment above).

    Plan, one PR:

    1. RED: two cases in test_dock_state_restart: a dock floated while the window is resized stays floating, also after a restart; a Reset Docks while the window is resized stays, and is what quit saves. Both fail on master and pass with the helper from before frontend: restore the dock layout again when the window grows after the start (#3740) #4841.
    2. GREEN: DockProportions compares where the docks are (area, floating, hidden, tabs), not the saved bytes, before it restores the start layout, so a change that comes with a resize stops the restore. Reset Docks also stops it.

    The existing #3740 cases must still pass. I expect a draft PR today. Refs #5230 until it is confirmed on Hyprland.

  3. added
    ready
    on Nov 19, 2026
  4. vpacher commented on Nov 19, 2026

    @vpacher
    Member

    The fix is now on master (#5245). A dock change now counts as yours even when the window is resized at the same time, and Reset Docks stays reset. A quit then saves your layout, not the one from the start.

    Can you check it on Hyprland with the next obs-studio-rust-git build? Please check these:

    1. Start with your current settings, move or float a dock, quit, and start again. The dock should be where you left it.
    2. Reset Docks, quit, and start again. The default layout should stay.
    3. Your usual start (next to a terminal, then the full workspace) without touching a dock. The saved layout should come back, as with frontend: restore the dock layout again when the window grows after the start (#3740) #4841.

    If something still goes wrong, the steps (window state at the start, what you changed, then quit and start) let me turn it into a test. This issue stays open until you confirm it.

  5. vpacher commented on Nov 19, 2026

    @vpacher
    Member

    After #5245 I reviewed the whole dock layout code and found four more cases where a dock change is lost at quit or snaps back.

    We inherited the plain Qt save and restore from upstream. Since then we added fixes on top of it, one case at a time (#2225, #3740, this issue). Some of those fixes made other cases worse.

    So I will replace this logic with one clean model and test the known cases against it first. This issue stays open for that work.

  6. vpacher commented on Nov 20, 2026

    @vpacher
    Member

    Update to my claim: the decisions and the plan for the dock layout rewrite.

    Rule: the saved layout changes only when you change it. A change of the window size (a resize, a maximize, a tiling window manager that retiles) never changes what is saved and never undoes your change.

    Decisions:

    • D1. A bigger window: dock areas (the side column width, the bottom area height) keep their pixels, and the preview gets the extra space, as upstream does. Docks side by side in a row keep their shares of that row. This replaces the share rule of frontend: Side dock columns get their width back when the window widens (#2225) #2434 for dock areas: a side column no longer gets twice as wide on maximize.
    • D2. A window resize that you make by hand and a retile by the window manager are the same thing: a window change. The code cannot tell them apart reliably.
    • D3. When you resize one dock in a small window, only that dock gets a new size. The other docks keep their sizes and get them back when the window is big enough again.
    • D4. Floating docks keep their position and size where the platform reports them (X11, Windows, macOS). Wayland does not report a window position, so there the window manager places them.
    • D5. Save the dock layout when you change it, not only at quit, so a crash keeps your changes. This comes in a separate PR after the rewrite.
    • D6. A new key BasicWindow/DockSizes keeps the dock sizes you set, with a hash of the DockState they belong to. DockState stays the normal Qt layout, so upstream OBS can still read a profile written by obs-rust. If upstream OBS writes DockState in between, the hash does not match and obs-rust ignores the old sizes.

    There is no code for a specific window manager or platform. Each test case runs twice, under a scripted floating window manager and under a scripted tiling window manager, and both runs must save the same layout.

    Plan, one PR at a time:

    1. Tests only: the two window-manager profiles in test_dock_state_restart, and tests that record what works today. Each unclear edge case gets a result: it works, it is a bug, or it needs a decision. I will post the result table here.
    2. A new Rust crate obs-dock-layout with the layout model. It has no Qt and no platform code, so its tests run on all six CI targets. It is not used yet.
    3. Use it in the frontend and delete DockProportions. Its RED tests are the four cases I found in the review (a dock change that is lost at quit or snaps back). After the start, the frontend never restores an old layout again, except for Reset Docks and the service layouts (Twitch, YouTube, Restream).
    4. Save on change (D5).

    CI now builds and runs the dock tests (#4837, fixed by #5265 and #5270). Before that, CI did not run them.

    @alerque, your Hyprland check of #5245 is still useful. It tells me what the rewrite must keep.

  7. alerque commented on Nov 20, 2026

    @alerque
    Author
    1. Start with your current settings, move or float a dock, quit, and start again. The dock should be where you left it.

    Nope failed hard again on this step.

    After the debacle the other day I'd been using 1.0.1beta.20261118.r54.gd8f5045-1 for a couple days including several recording sessions and restarts.

    Just now I built and installed 1.0.1beta.20261119.r51.gb3a32a9-1.

    I did as you said, opened up, moved one dock from it's home to floating, then quit. Then re-opened. No docks. All of them are disabled in the docks menu, and enabling them one by one obviously brings them "back" to default locations, not where I had them.

    But by default locations I mean location only, not size. They are in the default dock order, but all squished and weird. After enabling them all again I used "reset ui" to get a sane starting point for moving them around again.

  8. 3 remaining items

  9. vpacher commented on Nov 21, 2026

    @vpacher
    Member

    The dock layout logic is now replaced on master (#5362, #5411). Your last build (b3a32a9) did not have this change yet. Related fixes: #5410 (quit with floating docks) and #5412 (macOS).

    I tested master 224faff on Hyprland 0.56.2 (Omarchy), with the AUR obs-rust-git recipe pinned to that commit, on a tiled workspace with native Wayland:

    1. Float a dock (double-click its title), resize it, quit with File → Exit, start again: the dock comes back floating, at the size I gave it.
    2. Reset Docks, float one dock, quit, start again: all docks come back, the floated one too.

    On the same machine, some things do not work. Stock OBS 32.2.2 (Arch obs-studio) does the same in each case, so they are not from obs-rust:

    • Floating dock position: a Wayland app cannot set where its windows go. Hyprland places a floating dock (on my machine, on top of the main window). OBS restores the size but not the position.
    • Drag a dock out of the window: on Wayland, Qt needs the xdg-toplevel-drag protocol for this. KWin and Mutter have it, Hyprland does not. On Hyprland only a double-click floats a dock, and dragging a dock back in is unreliable.
    • XWayland (QT_QPA_PLATFORM=xcb): a floating dock never shows. Hyprland drops the map request for an X11 window that was first a child window and then moved to the root window, and Qt does that for a floating dock ([Bug]: XWayland windows created as child and later reparented to root are never registered or mapped hyprwm/Hyprland#16698). The dock is floating and enabled, but you cannot see it, and it stays like that after each restart.

    Two questions about your "no docks" result on b3a32a9:

    • Do you start OBS under XWayland (for example for browser docks)? The Platform: line near the top of the log tells: Wayland or X11. Under XWayland, a floated dock goes invisible as described above.
    • In the Docks menu, were the docks unchecked, or checked but not visible?

    When you have a build at 224faff or newer, can you do the two steps above on your setup, and also your usual case: change the sizes of docked docks, quit, start again? Please tell me what you see. If something fails, please attach the log of that start and your user.ini (the lines geometry, DockState and DockSizes).

  10. moved this from In progress to Ready in obs-rust Multiviewon Nov 22, 2026
  11. KelboLive commented on Dec 1, 2026

    @KelboLive
    Contributor

    Claiming: #5230 — a code audit of current master leaves one real defect from the report: migration of a pre-rewrite dock state.

    1. DockLayout::Save() can write the live layout before the first Start(); during OBSBasic construction every main dock is hidden (OBSBasic.cpp.hpp:361-368), so an early saveAll() writes an all-hidden DockState. Guard Save() until Start() has run.
    2. A DockState written before the dock-layout rewrite (no DockSizes, HasSizes() false) in which every default dock is hidden is loaded and rewritten forever. After a successful Load(), when !HasSizes() and no default dock is visible, reset to the default layout once and log why. A genuinely all-hidden layout that has matching DockSizes must keep working (e11_all_docks_hidden).

    RED tests in test/cmocka/test_dock_state_restart.cpp for all three; one PR. The other reported symptoms are fixed on master (placement, sizes, Reset, Lock Docks).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ready

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions