diff options
Diffstat (limited to 'sway')
-rw-r--r-- | sway/input/seatop_default.c | 17 | ||||
-rw-r--r-- | sway/input/seatop_move_floating.c | 1 | ||||
-rw-r--r-- | sway/input/seatop_move_tiling.c | 1 | ||||
-rw-r--r-- | sway/input/seatop_resize_floating.c | 1 | ||||
-rw-r--r-- | sway/input/seatop_resize_tiling.c | 2 |
5 files changed, 10 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) { | |||
192 | static void cursor_do_rebase(struct sway_cursor *cursor, uint32_t time_msec, | 192 | static void cursor_do_rebase(struct sway_cursor *cursor, uint32_t time_msec, |
193 | struct sway_node *node, struct wlr_surface *surface, | 193 | struct sway_node *node, struct wlr_surface *surface, |
194 | double sx, double sy) { | 194 | double sx, double sy) { |
195 | struct wlr_seat *wlr_seat = cursor->seat->wlr_seat; | ||
195 | // Handle cursor image | 196 | // Handle cursor image |
196 | if (surface) { | 197 | if (surface) { |
197 | // Reset cursor if switching between clients | 198 | if (seat_is_input_allowed(cursor->seat, surface)) { |
198 | struct wl_client *client = wl_resource_get_client(surface->resource); | 199 | wlr_seat_pointer_notify_enter(wlr_seat, surface, sx, sy); |
199 | if (client != cursor->image_client) { | 200 | wlr_seat_pointer_notify_motion(wlr_seat, time_msec, sx, sy); |
200 | cursor_set_image(cursor, "left_ptr", client); | ||
201 | } | 201 | } |
202 | } else if (node && node->type == N_CONTAINER) { | 202 | } else if (node && node->type == N_CONTAINER) { |
203 | // Try a node's resize edge | 203 | // Try a node's resize edge |
@@ -217,14 +217,7 @@ static void cursor_do_rebase(struct sway_cursor *cursor, uint32_t time_msec, | |||
217 | cursor_set_image(cursor, "left_ptr", NULL); | 217 | cursor_set_image(cursor, "left_ptr", NULL); |
218 | } | 218 | } |
219 | 219 | ||
220 | // Send pointer enter/leave | 220 | if (surface == NULL) { |
221 | struct wlr_seat *wlr_seat = cursor->seat->wlr_seat; | ||
222 | if (surface) { | ||
223 | if (seat_is_input_allowed(cursor->seat, surface)) { | ||
224 | wlr_seat_pointer_notify_enter(wlr_seat, surface, sx, sy); | ||
225 | wlr_seat_pointer_notify_motion(wlr_seat, time_msec, sx, sy); | ||
226 | } | ||
227 | } else { | ||
228 | wlr_seat_pointer_clear_focus(wlr_seat); | 221 | wlr_seat_pointer_clear_focus(wlr_seat); |
229 | } | 222 | } |
230 | } | 223 | } |
diff --git a/sway/input/seatop_move_floating.c b/sway/input/seatop_move_floating.c index 73e48964..8f133c36 100644 --- a/sway/input/seatop_move_floating.c +++ b/sway/input/seatop_move_floating.c | |||
@@ -60,4 +60,5 @@ void seatop_begin_move_floating(struct sway_seat *seat, | |||
60 | container_raise_floating(con); | 60 | container_raise_floating(con); |
61 | 61 | ||
62 | cursor_set_image(seat->cursor, "grab", NULL); | 62 | cursor_set_image(seat->cursor, "grab", NULL); |
63 | wlr_seat_pointer_clear_focus(seat->wlr_seat); | ||
63 | } | 64 | } |
diff --git a/sway/input/seatop_move_tiling.c b/sway/input/seatop_move_tiling.c index 64a16c09..7c31e695 100644 --- a/sway/input/seatop_move_tiling.c +++ b/sway/input/seatop_move_tiling.c | |||
@@ -327,6 +327,7 @@ void seatop_begin_move_tiling_threshold(struct sway_seat *seat, | |||
327 | seat->seatop_data = e; | 327 | seat->seatop_data = e; |
328 | 328 | ||
329 | container_raise_floating(con); | 329 | container_raise_floating(con); |
330 | wlr_seat_pointer_clear_focus(seat->wlr_seat); | ||
330 | } | 331 | } |
331 | 332 | ||
332 | void seatop_begin_move_tiling(struct sway_seat *seat, | 333 | void seatop_begin_move_tiling(struct sway_seat *seat, |
diff --git a/sway/input/seatop_resize_floating.c b/sway/input/seatop_resize_floating.c index b6950bbf..3d95295c 100644 --- a/sway/input/seatop_resize_floating.c +++ b/sway/input/seatop_resize_floating.c | |||
@@ -160,4 +160,5 @@ void seatop_begin_resize_floating(struct sway_seat *seat, | |||
160 | const char *image = edge == WLR_EDGE_NONE ? | 160 | const char *image = edge == WLR_EDGE_NONE ? |
161 | "se-resize" : wlr_xcursor_get_resize_name(edge); | 161 | "se-resize" : wlr_xcursor_get_resize_name(edge); |
162 | cursor_set_image(seat->cursor, image, NULL); | 162 | cursor_set_image(seat->cursor, image, NULL); |
163 | wlr_seat_pointer_clear_focus(seat->wlr_seat); | ||
163 | } | 164 | } |
diff --git a/sway/input/seatop_resize_tiling.c b/sway/input/seatop_resize_tiling.c index 6b705823..020bba1b 100644 --- a/sway/input/seatop_resize_tiling.c +++ b/sway/input/seatop_resize_tiling.c | |||
@@ -105,4 +105,6 @@ void seatop_begin_resize_tiling(struct sway_seat *seat, | |||
105 | 105 | ||
106 | seat->seatop_impl = &seatop_impl; | 106 | seat->seatop_impl = &seatop_impl; |
107 | seat->seatop_data = e; | 107 | seat->seatop_data = e; |
108 | |||
109 | wlr_seat_pointer_clear_focus(seat->wlr_seat); | ||
108 | } | 110 | } |