aboutsummaryrefslogtreecommitdiff
path: root/sway/input/seatop_default.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/input/seatop_default.c')
-rw-r--r--sway/input/seatop_default.c17
1 files changed, 5 insertions, 12 deletions
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);
}
}