Invisible cursor with GNOME-on-Wayland
Bug summary
On my Arch install (GNOME 43.3, Wayland), when I open the Looking Glass client, it causes the cursor to become invisible for any other fullscreen window: games, browsers, etc. I tested this with an all-Wayland setup (LG client and Firefox on Wayland). The only way to restore the cursor is to terminate the session, then log back in.
#1939 has the same symptoms, but the description seems to be unrelated. In this thread, several users report being able to work around this issue by temporarily disabling mutter's unredirect mechanism: https://extensions.gnome.org/extension/1873/disable-unredirect-fullscreen-windows/. I use the extension on my system whenever I'm in the middle of something and don't want to restart my GNOME session.
After doing a bit of investigating, I managed to narrow down the issue to the wl_pointer_set_cursor
call(s) in the LG client. It seems that, by disabling LG's custom "square" cursor, the bug no longer occurs. This is how I tested it:
--- a/client/displayservers/Wayland/cursor.c 2023-02-28 18:41:41.838281335 -0500
+++ b/client/displayservers/Wayland/cursor.c 2023-02-28 18:41:37.251567070 -0500
@@ -209,14 +209,17 @@
for (int i = 0; i < LG_POINTER_COUNT; ++i)
if (old[i])
wl_surface_destroy(old[i]);
}
void waylandSetPointer(LG_DSPointer pointer)
{
+ if (pointer == LG_POINTER_SQUARE)
+ pointer = LG_POINTER_ARROW;
+
wlWm.cursorId = pointer;
wlWm.cursor = wlWm.cursors[pointer];
wlWm.cursorHotX = wlWm.cursorHot[pointer].x;
wlWm.cursorHotY = wlWm.cursorHot[pointer].y;
if (wlWm.pointer)
wl_pointer_set_cursor(wlWm.pointer, wlWm.pointerEnterSerial, wlWm.cursor, wlWm.cursorHotX, wlWm.cursorHotY);
}
Steps to reproduce
With the minimal repro project I made (instructions for Fedora 37)
- Clone and compile the bugrepro project:
git clone https://github.com/notpeelz/bug-repro-gnome-cursor-disappear
cd bug-repro-gnome-cursor-disappear
dnf install cmake gcc pkgconf-pkg-config wayland-devel meson libdecor-devel
meson setup builddir
meson compile -C builddir
- Run the binary:
./builddir/bugrepro
- Put your cursor over the window. The cursor should change to a 2x2 dot
- Open your web browser and fullscreen it with F11
With the LG client
- Open the LG client
- Resize its window to something that doesn't match the aspect ratio of the guest's display
- Put your cursor over the black bars. The cursor should change to a 2x2 dot
- Open your web browser on the host and fullscreen it with F11
Relevant logs, screenshots, screencasts etc.
Demonstration of the bug
bug reproduction on Arch, Wayland, GNOME 43.3
Reproductions
Test date | GPU | Drivers | Kernel | Distro | DE/WM | X/Wayland? | Virtualized? | Can reproduce with LG client? | Can reproduce with standalone repro? |
---|---|---|---|---|---|---|---|---|---|
2023-02-27 | AMD Radeon 6900 XT | amdgpu | 6.2.1-arch1-1 | Arch | GNOME 43.3 | Wayland | No | Yes | Yes |
2023-02-27 | AMD Radeon 5700 XT | amdgpu | 6.1.13-200.fc37.x86_64 | Fedora 37 | GNOME 43.3 | Wayland | No | Yes | Yes |
2023-02-27 | Intel UHD Graphics 630 | didn't check | 6.1.13-200.fc37.x86_64 | Fedora 37 | GNOME 43.3 | Wayland | No | didn’t test | Yes |
2023-02-28 | NVIDIA GTX 980 TI | NVIDIA proprietary, 525.89.0.2 | 6.1.13-200.fc37.x86_64 | Fedora 37 | GNOME 43.3 | Wayland | Yes (KVM with GPU passthrough) | didn't test | No Note: causes the screen to flicker to black every time the mouse is moved over the repro program. Moving the mouse quickly over the window causes the screen to flicker a lot. |
2023-02-28 | NVIDIA GTX 980 TI | NVIDIA proprietary, 525.85.05 (drivers came preinstalled with the image) | 6.0.12-76060006-generic | PopOS 22.04 | GNOME 42.5 | Wayland | Yes (KVM with GPU passthrough) | didn't test | No |
2023-02-28 | AMD Radeon RX 580 | amdgpu | 6.1.13-200.fc37.x86_64 | Fedora 37 | GNOME 43.3 | Wayland | Yes (KVM with GPU passthrough) | didn't test | Yes |