Qt.qpa.wayland: Wayland does not support QWindow::requestActivate() issue

Hello everyone,
I’m trying to run a Qt application and I was able to run the executable in Yocto based image successfully. But when I try to run it with docker container, I’m getting following error.

qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
Segmentation fault

I was able to run Qt examples in Torizon core image and I’m trying to run this as following.

After start, I stop all docker containers with following command.

docker stop $(docker ps -a -q)

Then I start the Weston Container as mentioned in Qt Debian Container for Torizon

# docker run -e ACCEPT_FSL_EULA=1 -d --rm --name=weston --net=host --cap-add CAP_SYS_TTY_CONFIG \
             -v /dev:/dev -v /tmp:/tmp -v /run/udev/:/run/udev/ \
             --device-cgroup-rule='c 4:* rmw' --device-cgroup-rule='c 13:* rmw' \
             --device-cgroup-rule='c 199:* rmw' --device-cgroup-rule='c 226:* rmw' \
             torizon/weston-vivante:$CT_TAG_WESTON_VIVANTE --developer weston-launch \
             --tty=/dev/tty7 --user=torizon

Then if I start a Qt Wayland Container example with the following commnd, I can run it successfully.

# docker run -e ACCEPT_FSL_EULA=1 --rm -it --name=qt5 \
           -v /tmp:/tmp \
           -v /dev/dri:/dev/dri -v /dev/galcore:/dev/galcore \
           --device-cgroup-rule='c 199:* rmw' --device-cgroup-rule='c 226:* rmw' \
           torizon/qt5-wayland-examples-vivante:$CT_TAG_QT5_WAYLAND_EXAMPLES_VIVANTE \

I have a qt5-wayland-examples-vivante container:2 container with some other Qt modules installed to run my application. If i run that container with same command with the container name modified, I get the above mentioned error. Any support is really appreciated.

Apalis iMX8QM 4GB WB IT v1.1 B
Ixora V1.1A

Thanks in advance.

Greetings @imeshsps,

The issue here seems fairly straightforward as the error message suggests this Qt function QWindow::requestActivate() is not supported by Wayland. For context Weston/Wayland is the graphical stack we use in TorizonCore containers.

Various threads on this topic show that this behavior is normal and intended from Qt: Wayland does not support QWindow::requestActivate() · Issue #288 · githubuser0xFFFF/Qt-Advanced-Docking-System · GitHub

Now what you can try is using a different graphical backend for Qt. This is possible by setting the QT_QPA_PLATFORM environment variable in the container where the Qt application is being executed, before you execute the application. You can try alternative backends like eglfs or linuxfb. Perhaps other backends support this function in Qt. Though keep in mind we haven’t thoroughly tested all the possible Qt backends so you might encounter other issues or strangeness.

Best Regards,

Thank you very much for your reply. I’ll try to change the graphical backend for Qt and give you an update.

After doing some google’ing I found that I can use it as:

 ./helloworld -platform linuxfb

and by running following after stopping the Weston container, I was able to get the interface running.

 ./helloworld -platform linuxfb:fb=/dev/fb0

also, we need to share /dev folder with the container by adding the following when launching the container.

-v /dev:/dev

finally, add the following to environment variables to get it working.

export fb=/dev/fb0
export QT_QPA_PLATFORM=linuxfb

If you want to get the mouse curser,

export QT_QPA_EVDEV_MOUSE_PARAMETERS=/dev/input/event*
export QT_QPA_GENERIC_PLUGINS=evdevmouse

you can get * from,

cat /proc/bus/input/devices

@jeremias.tx Thanks and I really appreciate your support.

Glad I was able to help!