wl_backend: stop resetting cursor to left_ptr on every surface enter — let clients set their own cursor
This commit is contained in:
parent
9592cf295e
commit
7fcfb0870d
|
|
@ -6430,14 +6430,13 @@ wl_update_pointer_focus(uint32_t time_msec)
|
|||
wl_state.pointer_x, wl_state.pointer_y, &sx, &sy, &view);
|
||||
}
|
||||
|
||||
/* Don't reset cursor during an active WM policy grab (move/resize) —
|
||||
* pointer_change_grab manages the cursor during these operations. */
|
||||
/* Track last focused surface for cursor reset on focus leave.
|
||||
* We do NOT reset to left_ptr on enter — the client sets its own
|
||||
* cursor via wl_pointer.set_cursor (handle_seat_request_cursor). */
|
||||
static struct wlr_surface *last_focused_surface = NULL;
|
||||
if (surface) {
|
||||
if (surface != last_focused_surface) {
|
||||
last_focused_surface = surface;
|
||||
if (!wl_state.grab_type)
|
||||
wl_set_cursor_image("left_ptr");
|
||||
}
|
||||
wlr_seat_pointer_notify_enter(wl_state.seat, surface, sx, sy);
|
||||
wlr_seat_pointer_notify_motion(wl_state.seat, time_msec, sx, sy);
|
||||
|
|
@ -6447,8 +6446,8 @@ wl_update_pointer_focus(uint32_t time_msec)
|
|||
last_focused_surface = NULL;
|
||||
}
|
||||
wlr_seat_pointer_clear_focus(wl_state.seat);
|
||||
/* Restore WM cursor — the client may have set its own cursor
|
||||
* surface which becomes invalid once pointer focus leaves. */
|
||||
/* Restore WM cursor when pointer leaves all surfaces.
|
||||
* Don't reset during grabs — pointer_change_grab manages that. */
|
||||
if (!wl_state.grab_type)
|
||||
wl_set_cursor_image("left_ptr");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue