Repository navigation
feat(framebuffer): Change orientation at runtime - #25059
Merged
MartinZikmund merged 1 commit intoOct 7, 2026
Merged
MartinZikmund merged 1 commit into
MartinZikmund merged 1 commit into
Conversation
Closes unoplatform#25058. FramebufferHostBuilder.Orientation(orientation, out setOrientation) hands the app a setter it can call at any time, from any thread. The change is applied on the UI thread: rendering and input rotate, the window bounds swap, and DisplayInformation reports the orientation and raises OrientationChanged. CurrentOrientation previously always reported Landscape on the framebuffer. Orientation and the unrotated screen size are kept in one snapshot so the render and input threads never pair a new orientation with a stale size. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Contributor
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-25059/wasm-skia-net9/index.html |
Contributor
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25059/docs/index.html |
Contributor
|
The build 237766 found UI Test snapshots differences: Details
|
MartinZikmund
approved these changes
Oct 7, 2026
3 of 5 tasks
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.
GitHub Issue: closes #25058
PR Type:
✨ Feature
What changed? 🚀
Until now, the Linux framebuffer's display orientation was fixed at startup by
FramebufferHostBuilder.Orientation(...). This PR adds an overload that also hands the app a setter, which can change the orientation while the app runs:Behavior:
SizeChangedwhen width and height swap). It also requests a redraw, because a 180° turn leaves the bounds unchanged.Landscape,Portrait,LandscapeFlippedandPortraitFlipped, and throwsArgumentOutOfRangeExceptionfor anything else.DisplayInformation.CurrentOrientationnow reports the actual orientation. It previously always returnedLandscapeon the framebuffer.DisplayInformation.OrientationChangedis raised on each change, through a new internalNotifyOrientationChangedon Skia.Implementation:
FrameBufferWindowWrapperkeeps the orientation and the unrotated screen size together in one immutable snapshot, swapped atomically.Validation:
Given_DisplayInformation_FrameBufferOrientationpassed 5 of 5: a quarter turn and a half turn on the running app, two rejected values, and a call before the host exists.Uno.UI.Runtime.Linux.FrameBufferandUno.UI.RuntimeTests.Skiabuild with analyzers on.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code