Skip to content

Memory of dock layouts has seriously regressed #5230

Open

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. 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.

  4. 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.

  5. 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.

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

Metadata

Metadata

Assignees

Labels

readyMeets the definition of Ready; claimable

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions