fix(viewer): emit 270° eglfs rotation as -90 so portrait-inverted isn't stretched#2973
Merged
Conversation
…'t stretched QT_QPA_EGLFS_ROTATION only accepts 180, 90 and -90. A literal 270 hits the "Invalid rotation" default branch in QEglFSScreen::geometry(): the QOpenGLCompositor still rotates the content, but the screen geometry never swaps to portrait, so the window lays out landscape and renders stretched (issue #2970 follow-up to #2971). - map 270 -> -90 in _build_webview_env (same orientation mod 360) - extend the eglfs rotation test to assert the -90 spelling Validated on the Pi 4 testbed: at 270° the webview viewport went from 1920x1080 (stretched) to 1080x1920 with the fix. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
There was a problem hiding this comment.
Pull request overview
This PR fixes Raspberry Pi 4 (eglfs) portrait-inverted (270°) rotation for web/image content by emitting QT_QPA_EGLFS_ROTATION=-90 instead of the unsupported literal 270, ensuring Qt’s eglfs path swaps screen geometry correctly and avoids stretched rendering.
Changes:
- Map
screen_rotation=270toQT_QPA_EGLFS_ROTATION=-90when building the viewer/webview environment on eglfs. - Extend the eglfs rotation unit test to assert the
-90spelling for 270°.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/anthias_viewer/__init__.py |
Normalizes eglfs rotation env var so 270° is expressed as -90 to trigger correct portrait geometry handling. |
tests/test_viewer.py |
Updates eglfs rotation test cases to validate 270 → -90 env emission. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5 tasks
vpetersson
added a commit
that referenced
this pull request
Jun 2, 2026
- CalVer (YYYY.0M.MICRO); still June 2026, micro 0 -> 1 - Ships the QML VideoOutput presentation path (#2975), the pi2/pi3 GStreamer HW video pipeline (#2972), and the x86 WLR_DRM_NO_ATOMIC display-freeze fix (#2978) - Also picks up Pi 4 eglfs rotation (#2971, #2973), the armv7 viewer spawn retry (#2969), the Writeback-connector headless guard (#2968), and viewer log cleanups (#2977, #2979) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.



Issues Fixed
Follow-up to #2970 (and #2971): salmanfarisvp's retest confirmed 0/90/180 now rotate correctly on Pi 4, but 270° (portrait inverted) renders stretched.
Description
QT_QPA_EGLFS_ROTATIONonly accepts180,90and-90. A literal270hits thedefault:("Invalid rotation") branch inQEglFSScreen::geometry(): the QOpenGLCompositor still rotates the content by 270°, but the screen geometry never swaps to portrait — the window lays out 1920x1080 landscape and gets squeezed into the portrait orientation, i.e. the stretch in the report.270→-90when composing the webview env in_build_webview_env(identical orientation mod 360, but takes the width/height-swap path in Qt).-90spelling for 270°.Validated on the Pi 4 testbed by probing the live webview viewport over D-Bus at
screen_rotation=270:QT_QPA_EGLFS_ROTATION=270)1920x1080(landscape layout, stretched)QT_QPA_EGLFS_ROTATION=-90)1080x1920(portrait, correct)Checklist
🤖 Generated with Claude Code