Closed ManIVIctorious closed 3 months ago
Maybe this is a sway issue? Using Fedora 34 beta and Gnome 40 I can use the latest anki flatpak without any problems. Trying with xeyes indicates that xwayland is used by the anki app. So for me it works great.
I wouldn't be overly surprised if there is a slight misconfiguration of my environment so Anki tires to run in xdg-shell. Does Anki show a window for you when you force the backend to Wayland? (You have to enable access to the Wayland socket first)
What I can confirm is that the system package (which uses an older version btw) runs perfectly fine even without xwayland while I have to force the flatpak version to use the x11 backend (which is done via the environment variable), else there is no window shown.
So maybe I should rephrase the issue to: In contrast to the packaged version (arch Linux) the Anki flatpak does not have Wayland support. When tried to run on the Wayland backend no window is shown. I couldn't find out what causes this lack of xdg-shell support and would highly appreciate if you could have a look into it.
To enhance use experience until this functionality is fixed, it would be helpful to enforce the use of x11 by setting the QT_QPA_PLATFORM=xcb
inside the sandbox to prevent from accidentally running into no window issues.
@ManIVIctorious I am sorry, but I am not very familiar with flatpaks. I tried running QT_QPA_PLATFORM=wayland flatpak run net.ankiweb.Anki
and similar commands, but that crashes the app with
Qt info: Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Qt critical: Failed to create wl_display (No such file or directory)
Qt info: Could not load the Qt platform plugin "wayland" in "" even though it was found.
Qt fatal: 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, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.
And additionally I get some selinux
errors.
So, in conclusion I would think the Anki flatpak does not like wayland. However, it automatically runs via xwayland on my system.
P.S.: Just tried the ancient packaged Anki version of Fedora. That one uses wayland by default, without any issues.
Should be fixed by https://github.com/flathub/net.ankiweb.Anki/pull/46 Meh, not really.
Hi, with Anki 2.1.48 Wayland support can be enabled passing —env=ANKI_WAYLAND=1. Don’t forget to give permission to access the Wayland socket.
@WasabiPizza thanks for the hint, it does work, but I need to set two environment variables: ANKI_WAYLAND=1
and QT_QPA_PLATFORM=wayland
, in addition to allowing the wayland socket.
Thanks, ANKI_WAYLAND=1 did the trick for me
Closing as solved
The current Anki flatpak build
does not seem to work under wayland (at least in sway enabling access to wayland socket is not enough to start the GUI), albeit the current arch linux package (version 2.1.35) seems to work properly, even on xdg_shell.
I spent about half an hour to investigate this but found no proper solution (a wayland enabled build would be highly appreciated). At least I could find a workaround to start the application via xwayland.
As an interim solution could you add the environment variable
QT_QPA_PLATFORM=xcb
to the flatpak build/manifest (not sure about the terminology here).