aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/seat.c
diff options
context:
space:
mode:
authorLibravatar Kirill Primak <vyivel@eclair.cafe>2023-01-09 18:28:59 +0300
committerLibravatar Simon Ser <contact@emersion.fr>2023-02-10 18:12:12 +0100
commit41e473f8c0d79b1a6026c85949bdbd1aa0788a16 (patch)
tree047fe77d90fb14b469b7f876412e8b3d7d7c55ef /sway/input/seat.c
parentwarp_to_constraint_cursor_hint: Handle NULL view (diff)
downloadsway-41e473f8c0d79b1a6026c85949bdbd1aa0788a16.tar.gz
sway-41e473f8c0d79b1a6026c85949bdbd1aa0788a16.tar.zst
sway-41e473f8c0d79b1a6026c85949bdbd1aa0788a16.zip
input/tablet: handle focusing NULL surface
Additionally, rename the function responsible for switching focus to match its behavior better. (cherry picked from commit 53c9a4a6438824abfb3d539bf55aec92074977e0)
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r--sway/input/seat.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 646f3866..0bd33581 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -176,11 +176,11 @@ static void seat_keyboard_notify_enter(struct sway_seat *seat,
176 state->pressed_keycodes, state->npressed, &keyboard->modifiers); 176 state->pressed_keycodes, state->npressed, &keyboard->modifiers);
177} 177}
178 178
179static void seat_tablet_pads_notify_enter(struct sway_seat *seat, 179static void seat_tablet_pads_set_focus(struct sway_seat *seat,
180 struct wlr_surface *surface) { 180 struct wlr_surface *surface) {
181 struct sway_seat_device *seat_device; 181 struct sway_seat_device *seat_device;
182 wl_list_for_each(seat_device, &seat->devices, link) { 182 wl_list_for_each(seat_device, &seat->devices, link) {
183 sway_tablet_pad_notify_enter(seat_device->tablet_pad, surface); 183 sway_tablet_pad_set_focus(seat_device->tablet_pad, surface);
184 } 184 }
185} 185}
186 186
@@ -204,7 +204,7 @@ static void seat_send_focus(struct sway_node *node, struct sway_seat *seat) {
204#endif 204#endif
205 205
206 seat_keyboard_notify_enter(seat, view->surface); 206 seat_keyboard_notify_enter(seat, view->surface);
207 seat_tablet_pads_notify_enter(seat, view->surface); 207 seat_tablet_pads_set_focus(seat, view->surface);
208 sway_input_method_relay_set_focus(&seat->im_relay, view->surface); 208 sway_input_method_relay_set_focus(&seat->im_relay, view->surface);
209 209
210 struct wlr_pointer_constraint_v1 *constraint = 210 struct wlr_pointer_constraint_v1 *constraint =
@@ -1313,7 +1313,7 @@ void seat_set_focus_surface(struct sway_seat *seat,
1313 } 1313 }
1314 1314
1315 sway_input_method_relay_set_focus(&seat->im_relay, surface); 1315 sway_input_method_relay_set_focus(&seat->im_relay, surface);
1316 seat_tablet_pads_notify_enter(seat, surface); 1316 seat_tablet_pads_set_focus(seat, surface);
1317} 1317}
1318 1318
1319void seat_set_focus_layer(struct sway_seat *seat, 1319void seat_set_focus_layer(struct sway_seat *seat,