On Wayland, fix Window::set_cursor_visible(true)

Making the cursor back visible was simply forgotten and it was
always hiding instead.

Fixes: 2496098890 (Update wayland-rs to 0.30.0)
Fixes: #2820.
This commit is contained in:
Kirill Chibisov 2023-05-26 09:26:22 +03:00 committed by GitHub
parent 3c3be71a77
commit f3f46cb3f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -690,12 +690,16 @@ impl WindowState {
pub fn set_cursor_visible(&mut self, cursor_visible: bool) {
self.cursor_visible = cursor_visible;
for pointer in self.pointers.iter().filter_map(|pointer| pointer.upgrade()) {
let latest_enter_serial = pointer.pointer().winit_data().latest_enter_serial();
if self.cursor_visible {
self.set_cursor(self.cursor_icon);
} else {
for pointer in self.pointers.iter().filter_map(|pointer| pointer.upgrade()) {
let latest_enter_serial = pointer.pointer().winit_data().latest_enter_serial();
pointer
.pointer()
.set_cursor(latest_enter_serial, None, 0, 0);
pointer
.pointer()
.set_cursor(latest_enter_serial, None, 0, 0);
}
}
}