Skip to content

Fix Qt touch rotation when using display_lcd_rotate=2 on Venus OS 3.73+#51

Open
sragneau wants to merge 1 commit into
kwindrem:mainfrom
sragneau:fix/qt-touch-rotation-display_lcd_rotate
Open

Fix Qt touch rotation when using display_lcd_rotate=2 on Venus OS 3.73+#51
sragneau wants to merge 1 commit into
kwindrem:mainfrom
sragneau:fix/qt-touch-rotation-display_lcd_rotate

Conversation

@sragneau

Copy link
Copy Markdown

Problem

When using the alternate rotate command (display_lcd_rotate=2), the display rotates correctly but the touchscreen does not follow. On Venus OS 3.73+, the usual fix (running ts_calibrate) no longer works because:

  • Venus OS 3.73 uses KMS (Kernel Mode Setting) for the framebuffer
  • ts_calibrate cannot display calibration targets on the KMS framebuffer when the GUI is stopped
  • The GUI (start-gui.sh) uses QT_QPA_PLATFORM=linuxfb with direct evdev input — it ignores /etc/pointercal entirely

Fix

Inject QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/touchscreen0:rotate=180 into start-gui.sh when the altRotateDisplay option is active. This makes Qt rotate touch events 180° to match the display rotation.

The patch is:

  • Applied automatically on each install/reinstall when altRotateDisplay is set
  • Removed cleanly if the user switches to a different rotation option
  • Survives Venus OS updates: since SetupHelper calls the setup script after each Venus OS update, start-gui.sh (which gets overwritten by Venus OS updates) is automatically re-patched

Tested on

  • Venus OS v3.73
  • Raspberry Pi (raspberrypi2)
  • 5" DSI touchscreen with 180° rotation (display_lcd_rotate=2)

Note

ts_calibrate still works fine for fine-tuning once the rotation is correct, but the initial rotation fix must go through Qt's evdev parameters on Venus OS 3.73+.

When the alternate rotate command (display_lcd_rotate=2) is chosen,
the display rotates but the touchscreen does not. On Venus OS 3.73+,
ts_calibrate cannot display calibration targets because the KMS
framebuffer is not accessible without the GUI running.

Fix: inject QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS with rotate=180 into
start-gui.sh when altRotateDisplay is active. This makes Qt rotate
touch events to match the display rotation without requiring
ts_calibrate.

The patch is applied/removed automatically on each install/reinstall,
so it survives Venus OS updates (which overwrite start-gui.sh).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kwindrem

Copy link
Copy Markdown
Owner

Thanks for your work. Before I incorporate this, a couple of things should be discussed and addressed.

UNINSTALL does not remove the patch to start-gui.sh

What impact does this have with versions of Venus OS prior to v3.73? The package is currently compatible back to v2.73 but I have moved most of my packages to v3.10 being the first compatible version. I just missed RpiDisplaySetup.

What impact does this have on HDMI displays?

SetupHelper does have a file patching mechanism that is might be a better solution. It provides a mechanism to detect conflicts with other packages that modify the same file. However, I'm not sure how to address this if Venus OS versions prior to v3.73 need to remain unpatched.

Any change to a package must also update the version and changes files.

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.

2 participants