Orientation of Avalonia Application

Hardware:
Colibri iMX6DL
with Viola Carrier Board Rev 1.2
Torizon OS 6.4.0
image

Created a new Analonia application using the wizard…


image

Running the application on the LCD display which is in a portrait orientation (default settings in firmware) shows the application all working (with touch) ok.

Would it be possible to change the “display AND touch” orientation to landscape?

Cheers Jon

Hi @jon2023 ,

It may be possible to rotate the display via a kernel command line option, as detailed here:

You can then create a custom Torizon OS image with this option set using TorizonCore Builder, specifically the arguments field showed here:

As for the touchscreen rotation you might try creating a udev rule that sets the libinput calibration matrix:

Keep in mind I didn’t test any of the above, these are suggestions based on what I could find.


Given that the suggestions above may not be very simple to do, have you considered rotating the application itself i.e. rotating at the Avalonia level?

Best regards,
Lucas Akira

Hi lucas,

Thanks for the suggestions, I will take a look.

We have looked at rotating the Avalonia application, but there’s some unsupported features which don’t show correctly…

“Note that only scale transforms are currently handled correctly; rotate transforms are not handled correctly . This is because our popup positioning API (which comes from Wayland) makes applying rotate transforms rather difficult as the popup position is based on a Rect on the parent window. It will probably be possible to correctly handle rotate transforms here, but should probably be done in a separate PR if anyone fancies tackling it - as it may be tricky.”

Hi @jon2023 ,

Right, this appears to be a bug in Avalonia:

While as of now this is an open issue, someone has commented on a possible solution for it, see the last comment from August 29th, 2023. However, this probably will require building a custom version of the Avalonia framework itself.

Best regards,
Lucas Akira