You are not logged in.

#1 2021-06-06 18:13:18

indignation
Member
Registered: 2020-11-30
Posts: 7

Some Qt applications with 'QT_QPA_PLATFORM=wayland' fail to start

Since I enjoy wayland on Gnome I was interested in enabling it for my Qt applications as well. After consulting the wiki, installing 'qt5-wayland', adding the 'QT_QPA_PLATFORM=wayland' environment variable and rebooting, some (but not all!) of my Qt applications won't start anymore. While f.e. monero-wallet-gui and qt5ct work perfectly fine, i7z-gui or onlyoffice-desktopeditors don't. First, here's the error message I'm getting:

This application failed to start because it could not find or load the Qt platform plugin "wayland" in "".
Available platform plugins are: linuxfb, minimal, offscreen, vnc, xcb.

To troubleshoot, I tried exporting the QT_PLUGIN_PATH variable ('export QT_PLUGIN_PATH=/usr/lib/qt/plugins') as recommended on some forums, but that didn't help.
Here are my relevant environment variables:

XDG_SESSION_TYPE=wayland
QT_STYLE_OVERRIDE=adwaita
QT_QPA_PLATFORMTHEME=gnome
QT_QPA_PLATFORM=wayland

Here are my relevant packages:

adwaita-qt 1.3.1-1
qgnomeplatform 0.8.0-2
qt5ct 1.2-1
qt5-base 5.15.2+kde+r196-1
qt5-wayland 5.15.2+kde+r23-1
wayland 1.19.0-1
wayland-protocols 1.21-1
xorg-xwayland 21.1.1-1

Any suggestions?

Offline

#2 2021-06-06 22:19:14

arojas
Developer
From: Spain
Registered: 2011-10-09
Posts: 1,810

Re: Some Qt applications with 'QT_QPA_PLATFORM=wayland' fail to start

indignation wrote:

i7z-gui

wayland doesn't allow running GUI applications as root

indignation wrote:

onlyoffice-desktopeditors

No idea what that is, but sounds like a proprietary application which embeds its own Qt version, which probably doesn't include qtwayland.

Offline

#3 2021-06-07 13:36:56

indignation
Member
Registered: 2020-11-30
Posts: 7

Re: Some Qt applications with 'QT_QPA_PLATFORM=wayland' fail to start

arojas wrote:

wayland doesn't allow running GUI applications as root

That makes sense, thanks.

arojas wrote:

No idea what that is, but sounds like a proprietary application which embeds its own Qt version, which probably doesn't include qtwayland.

The command belongs to OnlyOffice, a free/libre office suite which strives for 100% compatibility with M$hit Office files (for the case where LibreOffice fails to format correctly). I got it as a binary from the AUR, so I guess that's why it isn't picking up my external qt5-wayland plugin (it appears that Qt is shipped bundled with the binary).
Well, I guess that explains everything really. I assume it isn't possible, but is there something I can do to keep the 'QT_QPA_PLATFORM=wayland' environment variable globally but override/unset it for certain applications, regardless of how I call them (f.e. over the command line, over my desktop environment, when some program invokes it, etc.)?

Last edited by indignation (2021-06-07 13:37:54)

Offline

#4 2021-06-07 13:58:57

icar
Member
Registered: 2020-07-31
Posts: 163

Re: Some Qt applications with 'QT_QPA_PLATFORM=wayland' fail to start

The easiest way is probably editing the .desktop file.

Online

#5 2021-06-07 14:22:40

progandy
Member
Registered: 2012-05-17
Posts: 4,329

Re: Some Qt applications with 'QT_QPA_PLATFORM=wayland' fail to start

indignation wrote:
arojas wrote:

wayland doesn't allow running GUI applications as root

That makes sense, thanks.

You can probably use waypipe to run the application as root and display it in your user wayland compositor, but it is not recommended to have all that GUI code running as root to minimize the attack surface.

Well, I guess that explains everything really. I assume it isn't possible, but is there something I can do to keep the 'QT_QPA_PLATFORM=wayland' environment variable globally but override/unset it for certain applications, regardless of how I call them (f.e. over the command line, over my desktop environment, when some program invokes it, etc.)?

As icar suggested, use the .desktop file. https://wiki.archlinux.org/title/Deskto … _variables

For the shell define an alias or a function. You could also override the execuable in the PATH with a script in /usr/local/bin that does the necessary setup.

Last edited by progandy (2021-06-07 14:30:37)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

Board footer

Powered by FluxBB