Strange bug with QT applications on Gnome Wayland session

Applications that use QT have the mouse cursor and text selection cursor cut in half on the Gnome Wayland session. I haven’t shared any screenshots because the cursor doesn’t show up. This behaviour is consistent for both Flatpak and repository-installed apps, but doesn’t manifest itself with GTK apps. The variable QT_QPA_PLATFORM is set to Wayland (the apps are not running in XWayland mode). However, for QT apps that don’t support Wayland and run in XWayland, the cursor shows up as normal.

Does anyone else experience this bug? I have found all sorts of bug reports related to mouse cursors, but nothing quite like this strange cut-in-half effect.

The default value is gnome since we’re using QGnomePlatform. What did you hope to accomplish setting that variable?

I was using it because the documentation in the Arch wiki said that it was necessary to launch Qt apps on the Wayland backend: Wayland - ArchWiki I was unaware that Manjaro used a different default.

Not all applications whether Qt or Gtk will play nice in Wayland. I would use the variable per application if necessary, not as a global environment variable; i.e.,

QT_QPA_PLATFORM=wayland wayland-application

Or with the environment variable set, use this to override it:

QT_QPA_PLATFORM=xcb x11-application

If I set QT_QPA_PLATFORM=gnome, Qt apps simply fail to start. For example, here is the output of Okular (edited):

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
qt.qpa.plugin: Could not find the Qt platform plugin "gnome" in ""
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, xcb.

Aborted (core dumped)

I have installed the qgnomeplatform package:

Like I mentioned above, you can override the environment variable on a per-application basis via terminal or modified desktop file; i.e.:

QT_QPA_PLATFORM=wayland okular

This doesn’t help with my problem. If I run any application in XWayland mode, it is a blurry upscaled eyesore. If I run any Qt program with QT_QPA_PLATFORM=wayland it has this strange mouse cursor artifact. If I run it with QT_QPA_PLATFORM=gnome it doesn’t start at all.

Can you confirm on your computer that running a Qt program with QT_QPA_PLATFORM=wayland on Gnome results in this mouse cursor artifact? I am using fractional scaling if that’s important. I don’t know if it’s a bug or a mis-configuration issue, but if you can replicate it, it’s definitely a bug.

Here is my /etc/environment if it helps:

#
# This file is parsed by pam_env module
#
# Syntax: simple "KEY=VAL" pairs on separate lines
#
GDK_SCALE=1.25
# These lines make Firefox hardware-decode h264 and vp9 video
QT_AUTO_SCREEN_SCALE_FACTOR=1
# Start Firefox in Wayland mode (for use on Gnome).
# Use MOZ_X11_EGL=1 in X.
MOZ_ENABLE_WAYLAND=1
MOZ_WAYLAND_DRM_DEVICE=/dev/dri/renderD128
# These lines are necessary to make QT apps work with .Xcompose.
GTK_IM_MODULE=ibus
QT_IM_MODULE=ibus
XCOMPOSEFILE=$HOME/.XCompose
XMODIFIERS=@im=ibus
# This line should make Qt apps use Wayland, according to Arch Wiki.
# Apparently this should be gnome according to Yochanan.
QT_QPA_PLATFORM=gnome
# For use with Kvantum themes
# QT_QPA_PLATFORMTHEME=qt5ct
# Pamac told me to add these:
QT_QPA_PLATFORMTHEME=gnome
QT_STYLE_OVERRIDE=kvantum
QT_AUTO_SCREEN_SCALE_FACTOR=1

It must be something to do with scaling, I can’t reproduce that with Okular.

Yes, you’re correct. I turned the scaling for my monitor down to 100% and the cursor artifact disappeared. Where do I report this bug?

Update: Strange, I am no longer able to replicate this bug on my system. Either it’s been fixed upstream, or it’s related to the theming of Qt applications. This is my /etc/environment (updated):

#
# This file is parsed by pam_env module
#
# Syntax: simple "KEY=VAL" pairs on separate lines
#

QT_AUTO_SCREEN_SCALE_FACTOR=1

#QT_QPA_PLATFORMTHEME="gnome"
QT_QPA_PLATFORMTHEME=qt5ct
#QT_STYLE_OVERRIDE="kvantum"

# Force to use Xwayland backend
# QT_QPA_PLATFORM=xcb
QT_QPA_PLATFORM=wayland
#Not tested: this should disable window decorations
# QT_WAYLAND_DISABLE_WINDOWDECORATION=1

EDITOR=/usr/bin/nano
# Needed for Firefox to use VA-API
MOZ_WAYLAND_DRM_DEVICE=/dev/dri/renderD128
MOZ_ENABLE_WAYLAND=1