Problem launching QT snaps in Wayland


#1

Since the last 2 or 3 revisions I have a problem trying to start the snap for qownnotes. I’m using Ubuntu 18.04.1 and Wayland and now when I try to start it I get this error:

$ qownnotes
Fatal: This application failed to start because it could not find or load the Qt platform plugin "wayland-egl".

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, xcb.

Reinstalling the application may fix this problem. ((null):0, (null))

And here’s the info about snapd:

$ snap --version
snap    2.35
snapd   2.35
series  16
ubuntu  18.04
kernel  4.15.0-33-generic

I’ve opened an issue in the qownnotes repo: https://github.com/pbek/QOwnNotes/issues/1004 But it seems a problem related to snapd + Ubuntu 18.04 + Wayland. Any ideas?

Thanks!


#2

Well, I’ve just compiled and uploaded musescore version 2.3.2 using launchpad and I’m seeing the same error when trying to launch musescore now:

$ musescore.mscore 
This application failed to start because it could not find or load the Qt platform plugin "wayland-egl".

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, xcb.

Reinstalling the application may fix this problem.

#3

Is the wayland QPA plugin included in the snap? Should be in $SNAP/usr/lib//qt/plugins/platform/ If not, add “qtwayland5” to the staged packages.


#4

Well, it did work: with qtwayland5 package in stage they do work now, the problem is that the apps look awful now under wayland…Is there any way to force the old behavior (to use Xwayland I guess)?
I’ve also tried to build a snap with core18 (so it’s using Qt 5.9.5) but the result is the same…


#5

You could set the DISABLE_WAYLAND environment variable to force x11 support. Something like this should do:

app:
  command: ....
  environment:
    DISABLE_WAYLAND: 1

Would you mind sharing what looks awful? Fonts wrong? Sizing? Are icons not using the correct theme?
Thanks
-G


#6

Thanks for the tip! That did the trick!

These are examples of the Keepassxc snap compiled with base: core18 & qtwayland5; with DISABLE_WAYLAND=1 (using Xwayland I guess):

And with no variable set (using Wayland-EGL):

And those are the messages I get when doing the latest:

$ keepassxc
QSocketNotifier: Can only be used with threads started with QThread
Using Wayland-EGL
EGL not available
Cannot find EGLConfig, returning null config
Using the 'xdg-shell-v6' shell integration
...

#7

@pachulo screenshots perfect, thank you. Icon themes look ok, but text sizes and theme colours are wrong. I’ll need to investigate that.
Thanks again!
-G


#8

Could it be something related to Qt?


Apart from the ugliness, copy seems to neither work…If so, I think it’s sensible to set the DISABLE_WAYLAND=1 env as the default for now…


#9

Can I include that in the QOwnNotes snap config already, without fear of damaging anything? :slight_smile:


#10

Yeah! With that and the inclusion of the qtwayland5 package in stage it should be good to go!


#11

Try plugging the gsettings interface. Based on the screenshots, it looks like the app is following the standard Ubuntu GTK theme on X11 but not Wayland. GTK uses a different method of selecting a theme for the X11 and Wayland backends, and the Wayland backend requires access to GSettings.


#12

Thanks for the tip but as far as I can tell, is already connected:

:gsettings chromium,gnome-calculator,gnome-characters,gnome-logs,gnome-system-monitor,keepassxc


#13

Ubuntu 18.04 has package qt5-gtk-platformtheme that should fix the theme issue, but I am running into errors when building on 18.04. The errors have to do with the desktop-qt5 cloud part still building in 16.04 so there ends up being conflicts in staged files between the app and cloud part files.


#14

@sigill I’ve tried what you say with Keepassxc:

And my build went OK:

but the app still looks quite ugly.


#15

It does look like your build worked. I saw the shared object at /usr/lib/x86_64-linux-gnu/qt5/plugins/platformthemes/libqgtk3.so. Perhaps you need to force using it by running keepassxc with environment variable QT_QPA_PLATFORMTHEME=gtk3? You can see info on QT plugin loading by setting QT_DEBUG_PLUGINS=1. Also, to rule out permission issues, you may want to try installing the snap in devmode.


#16

Well, it seems that the QT_QPA_PLATFORMTHEME=gtk3 option did indeed change something: now the application starts as ugly as before, but as you start working with it some stuff begins to look GTK-themed.

Quite strange behaviour, but I’m guessing it’s maybe a problem with QT 5.9.5 implementation for Wayland, because parts of the application not being re-drawn and so are also happening when QT_QPA_PLATFORMTHEME=gtk3 is not used…And besides that, stuff like copy pasting things neither work when using the Wayland implementation.