freeciv21
freeciv21 copied to clipboard
Running freeciv on ChromeOS through dev environment w/flatpak -- QT_QPA_PLATFORM
Describe the bug
An error is generated when running freeciv through flatpak on cmdline, and populated icons in the launcher do not work.
flatpak run net.longturn.freeciv21
qt.qpa.xcb: could not connect to display qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, xcb.
To Reproduce Steps to reproduce the behavior:
- Install flatpak in the dev environment
- Add flathub repo
- Shutdown linux dev enviroment
- Open linux dev enviroment
- Install freeciv flatpak
Expected behavior Launcher icons to work and for it to work from cmd line
Platform and version (please complete the following information):
- OS: ChromeOS dev environment
Additional context
This cmdline and a reboot should fix it locally
flatpak override --user --env=QT_QPA_PLATFORM=wayland net.longturn.freeciv21
The flatpak is compiled to x86_64
I guess it self-bifurcated to aarch64
?
It pulls about 1 GB in packages on first call to build the required environment, which is normal for a first flatpak install
And now this thread exists to help someone else.
I also suspect this could be addressed with a flatpak build option, but I am not strong with flatpaks.
I guess it self-bifurcated to aarch64?
aarch64
and arm64
usually refer to the same thing, the difference is mostly there to confuse people :sweat_smile:
The FlatHub bot builds both x86 and ARM binaries.
Qt checks the following variables when selecting its platform plugin:
-
XDG_SESSION_TYPE=x11|wayland
-
QT_QPA_PLATFORM
as you mentioned
I could reproduce your error by unsetting XDG_SESSION_TYPE
or setting it to x11
even though I'm on Wayland. This happens with Kde applications as well (tried org.kde.kcalc
). For instance:
$ (unset XDG_SESSION_TYPE; flatpak run org.kde.kcalc)
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
--> this is likely a problem with your setup or desktop environment edit: or the Kde platform for flatpak