fix(viewer): recognize all cage/Wayland boards for screen rotation#3047
Merged
Conversation
Screen rotation was a no-op on Raspberry Pi 5 (and likely generic arm64 cage boards): `_is_wayland_board()` only treated x86 as a Wayland board, so neither the linuxfb `:rotation=` option nor the wlr-randr path ran. - Key `_is_wayland_board()` off `QT_QPA_PLATFORM` starting with `wayland`, mirroring the docker/Dockerfile.viewer.j2 split (x86/arm64/pi5) instead of an x86-only DEVICE_TYPE check. - Update tests to pair DEVICE_TYPE with QT_QPA_PLATFORM as in production; switch linuxfb-intent tests off the (now wayland) pi5. - Add regression tests covering the board matrix and the Pi 5 wlr-randr rotation path. Validated end-to-end on a real Pi 5: both the boot-time apply and the live Settings reload now push the wlroots transform (90/270) to the connected display. Fixes #3044 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
There was a problem hiding this comment.
Pull request overview
Fixes screen rotation on Raspberry Pi 5 (and other cage/wlroots Wayland-based viewer targets) by correctly classifying Wayland boards and routing rotation through the wlroots (wlr-randr) path instead of Qt’s linuxfb-only :rotation= option.
Changes:
- Update
_is_wayland_board()to detect Wayland viaQT_QPA_PLATFORMstarting withwayland, matching the viewer image/Docker configuration across x86/arm64/pi5. - Add/adjust unit tests to cover the board/QPA matrix and specifically regress the Pi 5 Wayland rotation behavior (env composition +
wlr-randrinvocation). - Move linuxfb-intent tests off
pi5to a linuxfb board type to reflect production behavior.
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 |
Change Wayland-board detection to use QT_QPA_PLATFORM so Wayland targets take the wlr-randr rotation path. |
tests/test_viewer.py |
Expand/realign rotation tests to cover Wayland vs eglfs vs linuxfb behavior and add Pi 5 regression coverage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Fixes #3044 — screen rotation is a complete no-op on the Raspberry Pi 5 (and likely generic arm64 cage boards).
Description
_is_wayland_board()only treated x86 as a Wayland board, so on Pi 5 (DEVICE_TYPE=pi5,QT_QPA_PLATFORM=wayland) rotation misfired twice:_build_webview_env()appended a linuxfb-only:rotation=Noption the Qt wayland plugin ignores, and_apply_wlr_transform()(the wlr-randr path that actually rotates on cage/wlroots) was never called. Net result: the rotation menu did nothing.This keys
_is_wayland_board()offQT_QPA_PLATFORMstarting withwayland— the same signaldocker/Dockerfile.viewer.j2sets for x86/arm64/pi5 — so all cage boards route through the wlr-randr path x86 already used successfully, with no per-board allowlist to maintain.DEVICE_TYPEwithQT_QPA_PLATFORMas in production; linuxfb-intent tests moved off the (now Wayland) pi5 onto a genuine linuxfb board.Validated end-to-end on a real Raspberry Pi 5 (cage + Wayland, 4K Dell on HDMI-A-2):
screen_rotation=90→ logApplied wlroots transform 90 to output HDMI-A-2, compositorTransform: 90.90 → 270→ logScreen rotation changed: 90 -> 270/Applied wlroots transform 270, compositorTransform: 270._is_wayland_board()returnedFalseon the same board (reproduced the bug first).Checklist
QT_QPA_PLATFORM=wayland— and is covered by unit tests, but was not re-run on x86 hardware.)🤖 Generated with Claude Code