diff options
Diffstat (limited to 'sway/input')
-rw-r--r-- | sway/input/seat.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index 648e7914..81bef7bd 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -6,6 +6,7 @@ | |||
6 | #include "sway/input/cursor.h" | 6 | #include "sway/input/cursor.h" |
7 | #include "sway/input/input-manager.h" | 7 | #include "sway/input/input-manager.h" |
8 | #include "sway/input/keyboard.h" | 8 | #include "sway/input/keyboard.h" |
9 | #include "sway/ipc-server.h" | ||
9 | #include "sway/output.h" | 10 | #include "sway/output.h" |
10 | #include "sway/view.h" | 11 | #include "sway/view.h" |
11 | #include "log.h" | 12 | #include "log.h" |
@@ -309,18 +310,31 @@ void sway_seat_set_focus(struct sway_seat *seat, swayc_t *container) { | |||
309 | if (container->type == C_VIEW) { | 310 | if (container->type == C_VIEW) { |
310 | struct sway_view *view = container->sway_view; | 311 | struct sway_view *view = container->sway_view; |
311 | view_set_activated(view, true); | 312 | view_set_activated(view, true); |
312 | struct wlr_keyboard *keyboard = wlr_seat_get_keyboard(seat->wlr_seat); | 313 | struct wlr_keyboard *keyboard = |
314 | wlr_seat_get_keyboard(seat->wlr_seat); | ||
313 | if (keyboard) { | 315 | if (keyboard) { |
314 | wlr_seat_keyboard_notify_enter(seat->wlr_seat, view->surface, | 316 | wlr_seat_keyboard_notify_enter(seat->wlr_seat, |
315 | keyboard->keycodes, keyboard->num_keycodes, | 317 | view->surface, keyboard->keycodes, |
316 | &keyboard->modifiers); | 318 | keyboard->num_keycodes, &keyboard->modifiers); |
317 | } else { | 319 | } else { |
318 | wlr_seat_keyboard_notify_enter(seat->wlr_seat, view->surface, | 320 | wlr_seat_keyboard_notify_enter( |
319 | NULL, 0, NULL); | 321 | seat->wlr_seat, view->surface, NULL, 0, NULL); |
320 | } | 322 | } |
321 | } | 323 | } |
322 | } | 324 | } |
323 | 325 | ||
326 | if (last_focus) { | ||
327 | swayc_t *last_ws = last_focus; | ||
328 | if (last_ws && last_ws->type != C_WORKSPACE) { | ||
329 | last_ws = swayc_parent_by_type( | ||
330 | last_focus, C_WORKSPACE); | ||
331 | } | ||
332 | if (last_ws) { | ||
333 | wlr_log(L_DEBUG, "sending workspace event"); | ||
334 | ipc_event_workspace(last_ws, container, "focus"); | ||
335 | } | ||
336 | } | ||
337 | |||
324 | if (last_focus && last_focus->type == C_VIEW && | 338 | if (last_focus && last_focus->type == C_VIEW && |
325 | !sway_input_manager_has_focus(seat->input, last_focus)) { | 339 | !sway_input_manager_has_focus(seat->input, last_focus)) { |
326 | struct sway_view *view = last_focus->sway_view; | 340 | struct sway_view *view = last_focus->sway_view; |