Repository navigation
frontend: report a screen change as a resize to the display's layout - #4052
Merged
Merged
Conversation
…ze (RED) Refs #4010 Co-Authored-By: Claude Opus 5.5 <[email protected]>
… files (RED) The test linked OBSQTDisplay without SurfaceEventFilter's moc output and without the two platform hooks OBSQTDisplay calls. moc the filter, and stand in for PlatformResetsHiddenDisplay and HandlePlatformDisplayNativeEvent as the X11 platform file does. Refs #4010 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s (RED) The test called windowHandle()->setScreen() before the first show(), when the top-level widget has no QWindow yet, and crashed. QWidget::setScreen() works before and after show(). Refs #4010 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e (RED) Qt's offscreen platform keeps a window's size in pixels across a real screen change, so its size in points changes and a resize event comes too, which would hide the bug. macOS keeps the points and sends only QWindow::screenChanged. The test now sends the display's window that signal and no resize, and the pixel ratio comes from QT_SCREEN_SCALE_FACTORS (the offscreen "dpr" reaches the screen, not its windows). RED, Qt Frontend Linux job locally (ci/linux_qt_frontend.py, Qt 6.11.1): screen_change_without_resize_reports_a_resize: resized > 0 is not true Refs #4010 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…yout (GREEN) On macOS a window dragged to a screen with another pixel ratio keeps its size in points, so Qt sends no resize event, only QWindow::screenChanged. OBSQTDisplay resized its obs_display there but did not emit DisplayResized, so the studio-mode program view (and every display that lays out on that signal) kept the old pixel ratio's scale and position. The screenChanged handler now emits DisplayResized. GREEN, Qt Frontend Linux job locally: all 22 Qt-linked tests pass. The check by hand on macOS (Retina and an external display) follows with the next nightly. Refs #4010 Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=c9cf9f2b5cb27e9b7171bdb8cb27f6c260a0c85c secs=401 lanes=lint:run,dylint:reused@55c72dbe3fdb,rust-test:reused@4994ca4bb9fc,cross:reused@13f0be523ab3,tier2-linux:run,macos-native:n/a,windows-native:n/a Ci-Attestation: {"at":1794161849,"gate":"rust/all/fmt","host":"linux-x86_64","key":"efdd8a7776fd73ba13bca9a37bf3dc6c8ee284071d610de2ff56acd254d6d8c2","lane":"lint","parents":["cfe7bb49e5e52daf9415aa430bc5251bb1a93d9c"],"secs":34,"stamp":"d92eef7d88f240c287208d9d0386c4aa","tree":"c9cf9f2b5cb27e9b7171bdb8cb27f6c260a0c85c","v":1,"via":"run"} Ci-Attestation: {"at":1794161849,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"efdd8a7776fd73ba13bca9a37bf3dc6c8ee284071d610de2ff56acd254d6d8c2","lane":"lint","parents":["cfe7bb49e5e52daf9415aa430bc5251bb1a93d9c"],"secs":34,"stamp":"beb77d7468022026f4030f4029f27978","tree":"c9cf9f2b5cb27e9b7171bdb8cb27f6c260a0c85c","v":1,"via":"run"} Ci-Attestation: {"at":1794158143,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"4994ca4bb9fc29d79c925e3266c51cc36a844a0ed34cd874fbb0c0e063e93014","lane":"rust-test","parents":["cfe7bb49e5e52daf9415aa430bc5251bb1a93d9c"],"secs":null,"stamp":"019583631a1677152b199300c791c946","tree":"c9cf9f2b5cb27e9b7171bdb8cb27f6c260a0c85c","v":1,"via":"reused"} Ci-Attestation: {"at":1794158143,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"13f0be523ab3f0244bcadd4f260144cb0f09f14b8c5570eb1499014f8bc26f08","lane":"cross","parents":["cfe7bb49e5e52daf9415aa430bc5251bb1a93d9c"],"secs":null,"stamp":"e28283a35e0d8b2d8a39fde538d1569c","tree":"c9cf9f2b5cb27e9b7171bdb8cb27f6c260a0c85c","v":1,"via":"reused"} Ci-Attestation: {"at":1794158143,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"13f0be523ab3f0244bcadd4f260144cb0f09f14b8c5570eb1499014f8bc26f08","lane":"cross","parents":["cfe7bb49e5e52daf9415aa430bc5251bb1a93d9c"],"secs":null,"stamp":"4956d11d2407880c9cf43a042755323b","tree":"c9cf9f2b5cb27e9b7171bdb8cb27f6c260a0c85c","v":1,"via":"reused"} Ci-Attestation: {"at":1794158143,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"13f0be523ab3f0244bcadd4f260144cb0f09f14b8c5570eb1499014f8bc26f08","lane":"cross","parents":["cfe7bb49e5e52daf9415aa430bc5251bb1a93d9c"],"secs":null,"stamp":"acae70a30b04fc224ff0210ba9603bd9","tree":"c9cf9f2b5cb27e9b7171bdb8cb27f6c260a0c85c","v":1,"via":"reused"} Ci-Attestation: {"at":1794158143,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"13f0be523ab3f0244bcadd4f260144cb0f09f14b8c5570eb1499014f8bc26f08","lane":"cross","parents":["cfe7bb49e5e52daf9415aa430bc5251bb1a93d9c"],"secs":null,"stamp":"354c313e3ba4325119d1c6783315edb1","tree":"c9cf9f2b5cb27e9b7171bdb8cb27f6c260a0c85c","v":1,"via":"reused"} Ci-Attestation: {"at":1794161849,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"5867abaaf417e0f65beb8987d5345fc3c14310d7569da92cb35ad94fcc362f23","lane":"tier2-linux","parents":["cfe7bb49e5e52daf9415aa430bc5251bb1a93d9c"],"secs":401,"stamp":"110408e1227730d353d1ce4f85b49f7c","tree":"c9cf9f2b5cb27e9b7171bdb8cb27f6c260a0c85c","v":1,"via":"run"}
vpacher
marked this pull request as ready for review
November 8, 2026 18:20
vpacher
enabled auto-merge
November 8, 2026 18:20
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 #4010
What changes
On macOS, a window dragged to a screen with another pixel ratio keeps its size in points, so Qt sends no resize event, only
QWindow::screenChanged.OBSQTDisplayresized itsobs_displaythere but did not emitDisplayResized. The studio-mode program view lays out (ResizeProgram) only on that signal, so it kept the scale and position of the old pixel ratio until the window was resized by hand.OBSQTDisplay'sscreenChangedhandler now emitsDisplayResized(). The main preview already followed (it also connects the window'sscreenChanged); the program view, projectors and other displays that lay out onDisplayResizednow follow too.Ledger line in
docs/features.md.Test
test_display_screen_change(new, Linux, Qt Widgets) builds the realOBSQTDisplay(its own unity group) on Qt's offscreen platform with two screens;QT_SCREEN_SCALE_FACTORSgives the second pixel ratio 2 (the offscreendprsetting reaches the screen, not its windows). A real move on the offscreen platform is no model of macOS: it keeps a window's size in pixels across a screen change, so a resize event comes too and hides the bug. So the test sends the display's window what macOS sends,screenChangedand no resize, and expectsDisplayResized.RED and GREEN
screen_change_without_resize_reports_a_resize:resized > 0 is not true.Both measured with the "Qt Frontend Linux" job's own script (
ci/linux_qt_frontend.py, prebuilt Qt 6.11.1, Ubuntu 26.04) on a local machine. The local gate passed and stamped GREEN (its Tier 2 build has no Qt; CI's Qt job runs this test).Not done yet
The check by hand on macOS (studio mode, drag the window between a Retina and a non-Retina display) follows with the next nightly. Hence
Refs, notFixes; I close #4010 after that check.Test cost: 2 new cmocka cases, 0.02 s, no own threads.
🤖 Generated with Claude Code