aboutsummaryrefslogtreecommitdiff
path: root/sway/input/seat.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-03-30 00:11:00 -0400
committerGitHub <noreply@github.com>2018-03-30 00:11:00 -0400
commit9d7f47746cdcb0eed3cf41875d06a8ef238eef1c (patch)
tree997658454de40db3f8b76b68d658efaf2b686188 /sway/input/seat.c
parent7162b9bea4d66d61376ad3605e23e2d83bb95201 (diff)
parentf26ecd9f58bb672fe107660ce9b37f4bf0777a8c (diff)
Merge pull request #1648 from swaywm/swaybar-layers
Port swaybar to layer shell
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r--sway/input/seat.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index aa0b1d50..7cf0dd08 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -6,6 +6,7 @@
#include "sway/input/cursor.h"
#include "sway/input/input-manager.h"
#include "sway/input/keyboard.h"
+#include "sway/ipc-server.h"
#include "sway/output.h"
#include "sway/tree/view.h"
#include "log.h"
@@ -309,18 +310,30 @@ void sway_seat_set_focus(struct sway_seat *seat, struct sway_container *containe
if (container->type == C_VIEW) {
struct sway_view *view = container->sway_view;
view_set_activated(view, true);
- struct wlr_keyboard *keyboard = wlr_seat_get_keyboard(seat->wlr_seat);
+ struct wlr_keyboard *keyboard =
+ wlr_seat_get_keyboard(seat->wlr_seat);
if (keyboard) {
- wlr_seat_keyboard_notify_enter(seat->wlr_seat, view->surface,
- keyboard->keycodes, keyboard->num_keycodes,
- &keyboard->modifiers);
+ wlr_seat_keyboard_notify_enter(seat->wlr_seat,
+ view->surface, keyboard->keycodes,
+ keyboard->num_keycodes, &keyboard->modifiers);
} else {
- wlr_seat_keyboard_notify_enter(seat->wlr_seat, view->surface,
- NULL, 0, NULL);
+ wlr_seat_keyboard_notify_enter(
+ seat->wlr_seat, view->surface, NULL, 0, NULL);
}
}
}
+ if (last_focus) {
+ struct sway_container *last_ws = last_focus;
+ if (last_ws && last_ws->type != C_WORKSPACE) {
+ last_ws = container_parent(last_focus, C_WORKSPACE);
+ }
+ if (last_ws) {
+ wlr_log(L_DEBUG, "sending workspace event");
+ ipc_event_workspace(last_ws, container, "focus");
+ }
+ }
+
if (last_focus && last_focus->type == C_VIEW &&
!sway_input_manager_has_focus(seat->input, last_focus)) {
struct sway_view *view = last_focus->sway_view;