flathub/org.kde.digikam

Flickering on Ubuntu 22.04

Opened this issue · 10 comments

I got flickering issues on Ubuntu 22.04. Whenever a menu is opened and then closed it is stuck and the ui elements start flickering. If I move the menu it starts to form like trace of graphical artifacts. Only way to fix it is to restart the app.

FWIW: I can reproduce this issue (at least partly). The application freezes and starts flickering as soon as a I open any dialog e.g. the settings window. I'm running Fedora 36 (Linux 5.19.9-200.fc36.x86_64) with Gnome 42 on Wayland and Flatpak 1.12.7. I "debugged" the bug a little bit further: I can also reproduce the issue using the rpm version on Fedora (also digikam 7.7) but (surprisingly enough) not using the official AppImage (neither running 7.7 nor 7.8). I then switch to Gnome on Xorg and also tried the flatpak and rpm version (as well as the AppImage): all of them work perfectly fine. Back on Wayland, I checked whether Digikam runs on Wayland or uses Xwayland (using xeyes): The flatpak and rpm version use Wayland while the AppImages run using Xwayland. Apparently Digikam 7.7 or one of its dependencies has some sort of problem with Wayland. Therefore, IMO it is not a issue with the Flatpak version but with the app itself.

Nevertheless, I myself won't report this bug to the Digikam developers since 7.7 is not the latest available version and I don't know if this bug maybe is already fixed. It would be helpful, if someone could update the flathub version to the latest available one.

However, there are two possible workarounds I've found. 1. Use Xorg as your display server (at least for Ubuntu and Fedora it is possible to switch on the login screen). Keep in mind that this will switch your entire system to use Xorg (whether you want this or not and whether this is "good" or "bad" is a different issue). 2. Install Flatseal and disable the option "Wayland windowing system" in the section "Socket" just for Digikam. This seems to force the app (at least in this case) to run using Xwayland and this in turn avoids the graphics bug. I'll be using the second solution since it only affects the app itself but not the entire system.

Hi! Thank you for reporting the issue, @stkr22, and thanks a lot @mmk2410 for providing more info.

I am having the same issue on Fedora 38 using GNOME 44.1, Wayland and Flatpak 1.15.4.

Are there any news concerning this? I would really prefer not having to switch to Xorg just to use digiKam.

Thanks again!
T

I would really prefer not having to switch to Xorg just to use digiKam.

I don't need to switch to Xorg, Xwayland exist for that (and is on by default). The method mentionned above to remove the wayland permission should help.

My experience with Qt on wayland running GNOME is that it works porrly. Even upstream disable wayland if they detect a GNOME session (this is patched out)

Still having the issue on Ubuntu 23.04 Wayland with digikam 8.1.0. When the fix coming?

Does the flickering also happen on Digikam installed from the Ubuntu repository?

Yes, I have tried it with the original deb, AppImage and Flatpak on my system. I've been running 23.04 for a couple of months now. I think it has to do something with Qt having some problems with GNOME as I've tried on Kubuntu and it works just fine.

I have found a workaround for this issue. You can fix the flickering by enabling xcb for QT by export QT_QPA_PLATFORM=xcb. However, this removes the Wayland window decorations.

Something to do with using Qt own window frame instead of system frame? At least, someone else on SO thought so... https://stackoverflow.com/questions/71143549/is-it-safe-to-force-qt-qpa-platform-xcb-on-linux-desktop

Can confirm the workaround worked for me: Ubuntu 23.10 / Kernel 6.5.0-14 / AMD Ryzen, Radeon

Had the same issues as @mmk2410 with Fedora 39 (though oddly not on versions past.)

I used Flatseal and toggled off "Wayland windowing system."

If falls back to XWayland I guess and seems fine now. Note- I have both "X11 Windowing system" and "Fallback to X11 Windowing system" still toggled on (as default).

Fedora 39, 6.6.7-200.fc39.x86_64, AMD Ryzen™ 7 5700G with Radeon™ Graphics × 16

Debian 12 bookworm amd64 Gnome Wayland user here.

I too experience(d) flickering

  • with the Debian bookworm apt package digiKam release (debian-flavored digiKam version 4:7.9.0-1, based on vanilla digiKam version 7.9.0)
  • as well as with the flathub flatpak digiKam release (i.e., this issue) until recently.

But with the latest (as of this writing) flathub flatpak digiKam release based on digiKam version 8.3.0 from 2024-04-26 17:24:36 +0000 ( https://github.com/flathub/org.kde.digikam/tree/341fb68a95ba587d8450dd6222f510e60fabd022 ... IMHO this flathub buildbot build), the flickering is gone.

I have the hunch that Qt5-based applications (flatpak-based or not) often have this flickering issue under Wayland (including self-built application SDRangel (version 7.20.0) as well as the flatpak flathub-based org.mixxx.Mixxx release (version 2.4.0)), whereas Qt6-based applications are fine. The mentioned non-flickering digiKam flatpak flathub release bumped KDE Runtime from 5.15-23.08 to 6.6.

For the Debian bookworm apt package digiKam release, invoking digiKam with digikam -platform xcb resolves the flickering issue for me as well.

An indicator that flickering will sooner or later be apparent in some application seems to be when the affected (Qt5-based) application outputs/logs the following message to stdout during startup: QSocketNotifier: Can only be used with threads started with QThread.

Similar behavior manifests when running the paintedwindow Qt5 demo (from Debian apt package qtbase5-examples:

/usr/lib/x86_64-linux-gnu/qt5/examples/opengl/paintedwindow/paintedwindow
# outputs "QSocketNotifier: Can only be used with threads started with QThread" to *stdout*.
# shows flickering, especially when moving another window over the paintedwindow window.

/usr/lib/x86_64-linux-gnu/qt5/examples/opengl/paintedwindow/paintedwindow -platform xcb
# no output to stdout.
# adding the "... -platform xcb" resolves the flickering issue

As another solution for flickering Qt5-/org.kde.Platform/x86_64/5.15-23.08-based flatpak applications, a more recent version of the Mesa 3D Graphics Library may help.
Debian 12 bookworm's Mesa apt packages are based on Mesa vanilla version 22.3.6. I was able to build and system-wide install Mesa in version 24.0.6 (latest release as of this writing), which resolved the flickering issue in my self-built SDRAngel and flatpak Mixxx; though it did not resolve the flickering in the Debian apt package-installed digikam and paintedwindow applications (these still require the ... -platform xcb mitigation).