aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/seatop_default.c
diff options
context:
space:
mode:
authorLibravatar Alex Maese <memaese@hotmail.com>2019-04-19 16:13:49 -0500
committerLibravatar Simon Ser <contact@emersion.fr>2019-04-28 21:07:47 +0300
commit866a19b74324556815548132d209cf763c9753f5 (patch)
tree783e1418453d37b7314ccc7d830f52cb1299a3ba /sway/input/seatop_default.c
parentRemove extra inclusion of stdio.h (diff)
downloadsway-866a19b74324556815548132d209cf763c9753f5.tar.gz
sway-866a19b74324556815548132d209cf763c9753f5.tar.zst
sway-866a19b74324556815548132d209cf763c9753f5.zip
Clear pointer focus during move and resize seatops
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) {
192static void cursor_do_rebase(struct sway_cursor *cursor, uint32_t time_msec, 192static 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}