Skip to content

test: dock layout cases under a floating and a tiling window manager (Refs #5230) - #5359

Merged
vpacher merged 1 commit into
masterfrom
test/5230-dock-wm-profiles
Nov 20, 2026
Merged

vpacher merged 1 commit into
masterfrom
test/5230-dock-wm-profiles

Conversation

@vpacher

@vpacher vpacher commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Refs #5230 (step 1 of the plan in #5230 (comment))

Problem

The dock layout fixes so far were tested under one window behavior at a time. A fix for a tiling window manager (#4841) broke a case on a floating one (#5230). The rewrite needs tests that run every case under both.

Change

Test only, in test/cmocka/test_dock_state_restart.cpp (same binary). No production change.

  • A Session with two scripted window-manager profiles:
  • Each case must give the layout the user expects under both profiles. Both profiles must also save the same layout, compared in one full-size reference window. The code under test does not know which profile runs (W1).
  • User changes go through the real paths: separator drag, toggleViewAction, setFloating, Reset Docks as OBSBasic::on_resetDocks_triggered does it, quit through StateToSave(), config_save_safe and a reopen.

Results (edge cases of the spec)

Case Result
E1/E4 unchanged layout, also with 2 retiles at the start OK, test added
E2 narrow then wide in one session (#2225) OK, test added
E3 quit narrow, start wide OK, test added
E9 float a dock while the window retiles (#5230) placement OK, test added (placement only). Sizes: bug P7, see below
E10 dock at its minimum on purpose (#3740) OK, test added
E11 all docks hidden OK, test added
E13 current tab of a tab group OK, test added
E14 plugin dock added after the restore lands in the plugin's area, not its saved place, under both profiles, as upstream. Test added. Saved place = a decision, not part of the rewrite
E23 quit while the window is hidden OK, test added
E25 layout written by plain Qt, and back OK, test added
E15, E17, E19, E24 need OBSBasic (browser docks, profile switch, scale factor, signal quit): real-app check in step 3

P7 (new): under the tiling profile, floating a dock halves the tile at the same time. The helper takes that as the user's layout, and quit saves the row as squeezed into the half tile. The next full-size start gives one dock all the extra width: 1096/295/197 px, where the floating profile keeps the shares, 597/595/396 px. It joins P2, P4, P5 and P6 as a RED case of step 3, so this PR does not assert it.

Tests

  • test_dock_state_restart on build-rust (Ubuntu 26.04 container, the published Qt testlib asset, ci/linux_qt_frontend.py, the CI Qt job): the job passes, 30 Qt tests. The binary alone: 20/20 cases, 15 runs in a row green (10 before E14 was added, 5 on the final commit).
  • Before the comparison of saved layouts, E9 compared sizes and failed under the tiling profile with the numbers above. That run showed that the profile check catches a real difference.
  • Test cost: the binary takes about 8 s (Xvfb). Qt and cmocka, no own threads.

No features.md line (test-only change).

🤖 Generated with Claude Code

…(Refs #5230)

Step 1 of the dock layout rewrite (#5230): a test harness that runs each
dock case under two scripted window-manager profiles, and tests for what
works today.

- floating: the window changes size only when the case asks for it.
- tiling: the window starts in a small tile and is retiled twice (#3740),
  a floated dock is a new window and halves the tile at once (#5230), and
  another window that opens or closes retiles it.

Each case must give what the user expects under both profiles, and both
profiles must save the same layout (compared in one full-size reference
window). The code under test does not know which profile runs.

Cases: E1/E4 unchanged layout, E2 narrow then wide, E3 quit narrow,
E9 float a dock (placement only: under tiling, quit saves the row
squeezed into the half tile, P7, a RED case of step 3), E10 dock at its
minimum, E11 all docks hidden, E13 current tab of a tab group, E14 plugin
dock added after the restore (lands in the plugin's area, as upstream),
E23 quit while hidden, E25 round trip with a layout written by plain Qt.

No production change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vpacher
vpacher requested a review from zackees as a code owner November 20, 2026 08:26
@vpacher
vpacher enabled auto-merge November 20, 2026 08:27
@vpacher
vpacher added this pull request to the merge queue Nov 20, 2026
Merged via the queue into master with commit ba6eaa5 Nov 20, 2026
87 of 89 checks passed
@vpacher
vpacher deleted the test/5230-dock-wm-profiles branch November 20, 2026 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant