Repository navigation
frontend: obs-dock-layout, the dock layout model (Refs #5230) - #5362
Merged
Merged
Conversation
vpacher
marked this pull request as draft
November 20, 2026 13:12
vpacher
marked this pull request as ready for review
November 20, 2026 14:32
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 20, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 21, 2026
This was referenced Nov 21, 2026
Step 2 of the dock layout plan on #5230: a new crate with the layout model of the main window, no Qt and no platform code, so its decisions run on every CI target (W1, W5). Not used by the frontend yet; the adapter and its header come in step 3. The model keeps the sizes the user wants: the depth of each dock area in pixels and the length of each dock in its row, applied as shares of the row (D1). Only a separator drag changes them (D3, R7); a window change only puts them back where they fit. The record is the additive BasicWindow/DockSizes value with the hash of the DockState blob (D6). Tier 1 tests in obs-tests-gpu (the frontend's Rust category): record format, window changes (E2, E3, D1, R9), drags (D3 in a clamped row, R7), placement (hide/show, P7, E14, tabs), the restores of a layout with no known sizes (#3740, P2, P5, P6, E25), the C ABI, and one session under a floating and a tiling window manager that must save the same record (W2). Every test fails here: the model's methods and the record codec are todo!(). Co-Authored-By: Claude Opus 5.5 <[email protected]>
The model behind the stubs: - A row is the shown, docked docks of one area that share the area's edge; an area whose docks share one depth has a depth. - Window changes learn sizes not known yet (rescaled to the row's known sizes, never from a clamped row) and return the resizeDocks calls that give each row its shares and each area its pixels, as far as the preview has room. 1 px differences are left alone. - A separator drag records the docks and areas it resized; a press and release that resized nothing is no change. In a clamped row the dragged docks share the row's wanted total in their new ratio, so the untouched docks keep their shares (D3). - A dock moved to another area or tab group loses its length; hiding, showing and floating keep it. - Every number from the caller is clamped to +-2^20 px (and a record size above that is no record), so no sum or product can overflow and nothing panics across the C ABI. - A layout restored with no known sizes is restored again at each window change until it shows unclamped or the user changes something (the decision of 2026-11-20 on #5230); quit then saves that blob. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eview has room, RED (Refs #5230) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…view has room, GREEN (Refs #5230) A dock at its minimum across its area's depth is a window clamp only when the central widget is at its minimum too. Real Qt (test_dock_state_restart on the adapter) showed a column the user left at its minimum: its depth was never learned, so every start had no complete sizes and ignored the record. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…5230) hybrid_archive_reads_the_repository_lockfile (#5383) used obs-dock-layout as a package that the repository lockfile does not have. This PR adds that crate, so in the merge queue the dependency resolved and the archive was stale for "it changes the packages" instead of "cannot be read" (Fast Gate, macOS and Windows Rust Tests, run 44900012182). The fixtures now use obs-unrelated-fixture and unrelated-fixture-dep. Co-Authored-By: Claude Opus 5.5 <[email protected]>
vpacher
force-pushed
the
fix/5230-dock-layout-model
branch
from
November 21, 2026 12:11
a4ac02a to
3ead375
Compare
vpacher
enabled auto-merge
November 21, 2026 12:12
This was referenced Nov 21, 2026
amsterdamboomer
pushed a commit
to amsterdamboomer/obs-studio
that referenced
this pull request
Nov 21, 2026
…ust's packages (Refs obs-rust#5323) (obs-rust#5383) * test(build): a newer Cargo.lock that keeps libobs-rust's packages is not stale, RED (Refs obs-rust#5323) A kept Tier 2 tree fails with 'newer input Cargo.lock' when a PR adds a crate that libobs-rust does not use (merge-group run 44754423221, obs-rust#5362): Cargo correctly keeps the archive, and the lockfile is newer. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(build): stamp libobs-rust's lockfile closure beside the archive, GREEN (Refs obs-rust#5323) Cargo's depfile lists only path dependencies, so the archive's registry packages come from the lockfile: the closure of libobs-rust through the lock's dependency lists. When the archive is newer than Cargo.lock, the check saves that closure and the archive's mtime in liblibobs_rust.lock-closure. A newer Cargo.lock is fresh only when its closure equals the stamp for an unchanged archive. No stamp, a stamp for another archive build, or a lockfile that cannot be read stay stale. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
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 #5230 (step 2 of the plan in #5230 (comment))
Problem
DockProportionsdecides from Qt state alone: it comparessaveState()blobs and restores old ones. That is the cause of P2, P4, P5, P6 and P7, and its rules cannot be tested without a display. The rewrite needs a layout model that decides the same way under every window manager and runs on all six CI targets (W1, W5).Change
New crate
rust/obs-dock-layout. No Qt, no platform code,#![deny(unsafe_code)]outsidesrc/ffi/. Not used by the frontend yet: the Qt adapter, its header and the removal ofDockProportionscome in step 3.resizeDockscalls for each row and area where they fit, an area only into the room the preview has. A difference of 1 px is left alone.BasicWindow/DockSizes=v1;<hash of the DockState blob>;aB=200;dscenes=597;...(D6). A record for another blob (upstream OBS wroteDockStatein between), another version or a malformed entry is no record.src/ffi/, re-exported byrust/obs-frontend(obs_dock_layout_*). Every number from the caller is clamped to ±2^20 px, so nothing can overflow or panic across the ABI.Tests
Tier 1, 37 cases in
obs-tests-gpu(the frontend's Rust category,rust/obs-dock-layout/tests/dock_layout/):RED
90ad959c7: every case fails, the methods and the record codec aretodo!()(the C ABI test aborts the binary, as a panic cannot unwind out ofextern "C"). GREEN3aa790481: 35/35, and all 280 tests ofobs-tests-gpupass on build-rust (Linux x86_64);./lintpasses there.Added 2026-11-21 after the real-Qt check of step 3 (
d6d012116RED,a4ac02a58GREEN): a dock at its minimum across its area's depth is a window clamp only when the central widget is at its minimum too. With real Qt, a side column the user left at its minimum never got a depth, so every start counted as "no sizes" and the record was ignored. 37/37 on build-rust; RED failsa_side_column_at_its_minimum_with_room_is_learned.What these tests do not show yet. The snapshots are a hand-written model of Qt. Only the full-size row (597/595/396 px) comes from
test_dock_state_restart. These Qt behaviors are assumptions, checked against real Qt in step 3: proportional scaling on a window change, what a restore into a smaller window shows, and where the space of a hidden dock goes.Open for step 3, pinned by tests:
Tier 2 and Tier 3: not applicable (new code, no C original; upstream OBS has no such logic). Real-app check: step 3, when the adapter uses the model.
Test cost: the 35 cases take 0.00 s together, no own threads, no allocation that grows with input.
No features.md line: nothing user-visible until step 3.
Rebase on #5383
3ead375f2: the lockfile fixtures ofhybrid_archive_reads_the_repository_lockfile(#5383) usedobs-dock-layoutas a package name that no lockfile has. This PR adds that crate, so the merge-queue run (44900012182) found the dependency and failed in Fast Gate and the macOS and Windows Rust Tests. The fixtures now useobs-unrelated-fixtureandunrelated-fixture-dep; the 6archive_freshnesstests pass on macOS.🤖 Generated with Claude Code