Our Qt embedded system is displayed on a monitor mounted in portrait orientation. The system runs the Wayland compositor Weston as a window manager. HMI applications are shown rotated by 90 degrees – in landscape orientation. The system toolbar of Weston is visible. How can we configure Weston so that the applications are shown in portrait orientation and so that the system toolbar is removed?
In 2018, I had to solve this problem for the secondary terminal of the ROPA Tiger 6S sugar-beet harvester: the left terminal in this photo. The system runs on a terminal from Christ Electronics with a quad-core i.MX6. It uses eglfs as a trivial window manager. Eglfs allows a single application to render its contents on a single window. Eglfs doesn’t support rotating the screen on the i.MX6.
We developed the application in landscape orientation. While developing the application, we had to tilt our heads to the right to see the application in portrait orientation. When mounting the terminal, we rotated it 90 degrees counter-clockwise so that the users could see the application in portrait orientation. The QML code rotated the application 90 degrees clockwise. The solution was quite literally pain in the neck.
In 2021, I had to solve the same problem for another product. As I am not allowed to talk about this product, I’ll stick to my faithful harvester application. My system runs on a Toradex Verdin i.MX8M Mini computer-on-module. I built the Linux image tdx-reference-multimedia-image and its SDK for Yocto 3.1 Dunfell. The image contains Weston (the default Wayland compositor) and Qt 5.14.
By default, Weston expects the monitor in landscape orientation. Hence, the result from running the harvester application doesn’t come as a surprise.
Weston shows the application rotated by 90 degrees counter-clockwise and shows the system toolbar with the terminal application, date and time. We need to modify the Weston configuration file
/etc/xdg/weston/weston.ini on the Verdin system.
We add the following output section to
weston.ini and remove or comment out already existing output sections.
[output] name=HDMI-A-1 firstname.lastname@example.org transform=90
We find the
mode in the system log file
[18:16:42.897] Output HDMI-A-1 (crtc 33) video modes: email@example.com, preferred, current, 70.0 MHz firstname.lastname@example.org, 83.5 MHz
The Output Section of the
weston.ini documentation shows us how to rotate the screen. The line
transform=90 rotates the screen 90 degrees clockwise. We could also show the screen upside down (180 degrees rotation), flip the screen horizontally and apply some other transformations.
After rebooting the Verdin system, Weston shows the application in portrait orientation.
Weston still shows the system toolbar at the top. We remove the toolbar by setting the panel position to
none in the
shell section of the
The other value
top is the default panel position, as revealed by the Shell Section of the
weston.ini documentation. After rebooting the Verdin system, Weston shows the application in portrait orientation without the system toolbar.