swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.4k stars 1.1k forks source link

Qt Applications with wayland backend no cursor shape #5395

Open damianatorrpm opened 4 years ago

damianatorrpm commented 4 years ago

sway version 1.4 / git

Affects: Qt Applications with QT_QPA_PLATFORM=wayland Issue: Mouse cursor shape is not set (hovering on something that has custom cursor shape) works fine if run with QT_QPA_PLATFORM=xcb

emersion commented 4 years ago

What is the "mouse cursor shape"? Is it just the cursor image?

Please provide debug logs and clear reproduction steps (which app to use, etc).

damianatorrpm commented 4 years ago

All Qt applications are affected: Here a testcase with an empty window: shows mouse cursor shape with xcb not with wayland For example take any Qt Application you like and check the text edit field, the cursor should be the ones that is used for marking text https://github.com/damianatorrpm/sway-testcase/blob/master/testcase.tar.xz?raw=true

https://github.com/damianatorrpm/sway-testcase/blob/master/log

Xyene commented 4 years ago

Hmm, I can't reproduce this on my end on sway/wlroots master. The diagonal resize cursor shows up when running QT_QPA_PLATFORM=wayland ./testcase. The cursor changes correctly in KeePassXC and QDirStat as well.

My Qt library versions, for sanity checking ``` libqt5charts5:amd64:5.11.3-2 libqt5concurrent5:amd64:5.12.5+dfsg-10 libqt5core5a:amd64:5.12.5+dfsg-10 libqt5dbus5:amd64:5.12.5+dfsg-10 libqt5gui5:amd64:5.12.5+dfsg-10 libqt5network5:amd64:5.12.5+dfsg-10 libqt5opengl5:amd64:5.12.5+dfsg-10 libqt5opengl5-dev:amd64:5.12.5+dfsg-10 libqt5printsupport5:amd64:5.12.5+dfsg-10 libqt5qml5:amd64:5.12.5-5 libqt5quick5:amd64:5.12.5-5 libqt5quickparticles5:amd64:5.12.5-5 libqt5quickshapes5:amd64:5.12.5-5 libqt5quicktest5:amd64:5.12.5-5 libqt5quickwidgets5:amd64:5.12.5-5 libqt5sql5:amd64:5.12.5+dfsg-10 libqt5sql5-sqlite:amd64:5.12.5+dfsg-10 libqt5svg5:amd64:5.12.5-2 libqt5svg5-dev:amd64:5.12.5-2 libqt5test5:amd64:5.12.5+dfsg-10 libqt5waylandclient5:amd64:5.12.5-2+b1 libqt5waylandcompositor5:amd64:5.12.5-2+b1 libqt5widgets5:amd64:5.12.5+dfsg-10 libqt5x11extras5:amd64:5.11.3-2 libqt5xml5:amd64:5.12.5+dfsg-10 libqt5xmlpatterns5:amd64:5.12.5-1 libqt5xmlpatterns5-dev:amd64:5.12.5-1 qt5-default:amd64:5.11.3+dfsg1-1+deb10u3 qt5-gtk-platformtheme:amd64:5.12.5+dfsg-10 qt5-qmake:amd64:5.12.5+dfsg-10 qt5-qmake-bin:5.12.5+dfsg-10 qt5-qmltooling-plugins:amd64:5.12.5-5 ```

To debug this further, you can start sway from a TTY with sway -d |& tee /tmp/log.

Then, open up a terminal and run your testcase like so:

$ WAYLAND_DEBUG=1 QT_QPA_PLATFORM=wayland ./testcase |& grep --line-buffered -C2 set_cursor

The output of this should look roughly like the following.

[2457373.350] wl_pointer@3.motion(451920851, 174.121094, 43.335938)
[2457373.372]  -> wl_shm_pool@30.create_buffer(new id wl_buffer@32, 483840, 24, 24, 96, 0)
[2457373.378]  -> wl_pointer@3.set_cursor(8987, wl_surface@18, 11, 11)
[2457373.382]  -> wl_surface@18.attach(wl_buffer@32, 0, 0)
[2457373.386]  -> wl_surface@18.set_buffer_scale(1)
--
[2459700.248] wl_callback@33.done(9002)
[2459700.252] wl_pointer@3.enter(9003, wl_surface@14, 2.601562, 184.855469)
[2459700.263]  -> wl_pointer@3.set_cursor(9003, wl_surface@18, 11, 11)
[2459700.268]  -> wl_surface@18.attach(wl_buffer@32, 0, 0)
[2459700.271]  -> wl_surface@18.set_buffer_scale(1)

In another terminal window, run tail -F /tmp/log | grep -v IPC, and see if there's anything suspect that shows up in either of the windows while entering/leaving your testcase.

damianatorrpm commented 4 years ago

@Xyene I was thinking maybe it could be due to my Qt version 5.15 (latest). Would you mind sharing your env so I can see if there is some var I don't have set for some reason?

Xyene commented 4 years ago

Running with a stripped environment also works, so it shouldn't be env-var related:

$ env -i XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR WAYLAND_DEBUG=1 QT_QPA_PLATFORM=wayland ./testcase
oniGino commented 4 years ago

I'm running qt 5.14.2 and don't have this issue have you tried QT_QPA_PLATFORMTHEME=breeze ?