From 866a19b74324556815548132d209cf763c9753f5 Mon Sep 17 00:00:00 2001 From: Alex Maese Date: Fri, 19 Apr 2019 16:13:49 -0500 Subject: Clear pointer focus during move and resize seatops --- sway/input/seatop_default.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'sway/input/seatop_default.c') diff --git a/sway/input/seatop_default.c b/sway/input/seatop_default.c index 9cf58c47..9aa4ab1f 100644 --- a/sway/input/seatop_default.c +++ b/sway/input/seatop_default.c @@ -192,12 +192,12 @@ static void state_add_button(struct seatop_default_event *e, uint32_t button) { static void cursor_do_rebase(struct sway_cursor *cursor, uint32_t time_msec, struct sway_node *node, struct wlr_surface *surface, double sx, double sy) { + struct wlr_seat *wlr_seat = cursor->seat->wlr_seat; // Handle cursor image if (surface) { - // Reset cursor if switching between clients - struct wl_client *client = wl_resource_get_client(surface->resource); - if (client != cursor->image_client) { - cursor_set_image(cursor, "left_ptr", client); + if (seat_is_input_allowed(cursor->seat, surface)) { + wlr_seat_pointer_notify_enter(wlr_seat, surface, sx, sy); + wlr_seat_pointer_notify_motion(wlr_seat, time_msec, sx, sy); } } else if (node && node->type == N_CONTAINER) { // Try a node's resize edge @@ -217,14 +217,7 @@ static void cursor_do_rebase(struct sway_cursor *cursor, uint32_t time_msec, cursor_set_image(cursor, "left_ptr", NULL); } - // Send pointer enter/leave - struct wlr_seat *wlr_seat = cursor->seat->wlr_seat; - if (surface) { - if (seat_is_input_allowed(cursor->seat, surface)) { - wlr_seat_pointer_notify_enter(wlr_seat, surface, sx, sy); - wlr_seat_pointer_notify_motion(wlr_seat, time_msec, sx, sy); - } - } else { + if (surface == NULL) { wlr_seat_pointer_clear_focus(wlr_seat); } } -- cgit v1.2.3-54-g00ecf