Repository navigation
frontend: docks keep their shares when the window narrows and widens (#2225) - #2258
Merged
Merged
Conversation
#2225) Narrowing the main window clamps every dock in a row to its minimum width; widening it again shares the width out equally, so hand-sized docks come back all the same width. test_dock_proportions drives a QMainWindow with a row of five docks on the offscreen platform. Against the stub helper, dock 0 goes from 44.9% of the row to 19.9%.
…2225) DockProportions watches the main window's docks. A row of docks whose total size stays the same was resized from inside (a dragged separator): its shares are recorded, unless a dock is at its minimum. A row whose total changed was resized with the window: the saved shares are put back with resizeDocks once they fit. OBSBasic installs it after the default layout. test_dock_proportions passes: 709 221 252 197 197 before, 150 each when narrow, 709 221 252 197 197 after widening (was 315 each).
zackees
enabled auto-merge
October 24, 2026 23:25
This was referenced Oct 26, 2026
This was referenced Oct 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #2225 (the repro in #2225 (comment) from @alerque: change the window width and back, and the docks' relative sizes are lost).
Cause
Qt scales docks in proportion until one reaches its minimum. From then on it pins the clamped docks at their minimum, and on widening it shares the space out equally. Reproduced with plain Qt 6: five bottom docks at 709/221/252/197/197 with a 150 px minimum become 150 each at 774 px, then 315 each at 1600 px.
Fix
frontend/utility/dock-proportions.hpp(header-only, Qt Widgets only), installed byOBSBasicafter the default layout:resizeDocksonce they fit.Tests
test/cmocka/test_dock_proportions.cppagainst a no-op stub. 3 of 4 cases fail, e.g.dock 0: 44.9% of the row before, 19.9% after.Not covered: the profile ini save/restore half of the issue (no repro yet), and I have not run the full app with this change. That's why this says Refs, not Fixes. Features ledger line added.