wayland: Allow changing from a cursor shape to a NULL surface
Changing to a cursor shape would set the cursor surface to NULL, so trying to disable the cursor by setting the cursor surface to NULL was detected as no-change. This commit fixes the check by taking into account if the cursor shape is currently set. Also adds a ref-test for it. Fixes: 005b969227 ("wayland: Implement the cursor_shape_v1 protocol") Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3997 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4358>
This commit is contained in:
parent
b08cf5c135
commit
c6f167b1a1
BIN
src/tests/ref-tests/wayland_cursor_shape_3.ref.png
Normal file
BIN
src/tests/ref-tests/wayland_cursor_shape_3.ref.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
@ -128,6 +128,9 @@ main (int argc,
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_DEFAULT);
|
||||
wp_cursor_shape_device_v1_destroy (cursor_shape_device);
|
||||
wait_for_view_verified (display, 1);
|
||||
/* make sure disabling the cursor works */
|
||||
wl_pointer_set_cursor (pointer, serial, NULL, 0, 0);
|
||||
wait_for_view_verified (display, 3);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
@ -1199,7 +1199,8 @@ meta_wayland_pointer_set_cursor_surface (MetaWaylandPointer *pointer,
|
||||
|
||||
prev_cursor_surface = pointer->cursor_surface;
|
||||
|
||||
if (prev_cursor_surface == cursor_surface)
|
||||
if (prev_cursor_surface == cursor_surface &&
|
||||
pointer->cursor_shape == META_CURSOR_INVALID)
|
||||
return;
|
||||
|
||||
pointer->cursor_surface = cursor_surface;
|
||||
|
Loading…
x
Reference in New Issue
Block a user