mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-04 06:12:04 +08:00
wayland: Don't try to set the seat cursor when no pointer object exists
This commit is contained in:
@@ -1189,12 +1189,14 @@ static bool Wayland_ShowCursor(SDL_Cursor *cursor)
|
|||||||
Wayland_PointerObject obj;
|
Wayland_PointerObject obj;
|
||||||
|
|
||||||
wl_list_for_each (seat, &d->seat_list, link) {
|
wl_list_for_each (seat, &d->seat_list, link) {
|
||||||
obj.wl_pointer = seat->pointer.wl_pointer;
|
if (seat->pointer.wl_pointer) {
|
||||||
obj.is_pointer = true;
|
obj.wl_pointer = seat->pointer.wl_pointer;
|
||||||
if (mouse->focus && mouse->focus->internal == seat->pointer.focus) {
|
obj.is_pointer = true;
|
||||||
Wayland_CursorStateSetCursor(&seat->pointer.cursor_state, &obj, seat->pointer.focus, seat->pointer.enter_serial, cursor);
|
if (mouse->focus && mouse->focus->internal == seat->pointer.focus) {
|
||||||
} else if (!seat->pointer.focus) {
|
Wayland_CursorStateSetCursor(&seat->pointer.cursor_state, &obj, seat->pointer.focus, seat->pointer.enter_serial, cursor);
|
||||||
Wayland_CursorStateResetCursor(&seat->pointer.cursor_state);
|
} else if (!seat->pointer.focus) {
|
||||||
|
Wayland_CursorStateResetCursor(&seat->pointer.cursor_state);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_WaylandPenTool *tool;
|
SDL_WaylandPenTool *tool;
|
||||||
|
|||||||
Reference in New Issue
Block a user