aboutsummaryrefslogtreecommitdiff
path: root/sway/input/seat.c
diff options
context:
space:
mode:
authorxdavidwu <xdavidwuph@gmail.com>2019-10-18 18:57:17 +0800
committerSimon Ser <contact@emersion.fr>2020-04-04 11:42:04 +0200
commit5886187c6ef56307f15be475dc62785faf32ef35 (patch)
tree535283eca78c9a4ea63f26d9a13c1df48fe2b2f6 /sway/input/seat.c
parent7c44c769891553d1940285a1264b5fbe8de76c75 (diff)
Port input method and text input from rootston
This ports swaywm/wlroots#1203, swaywm/wlroots#1303, swaywm/wlroots#1308, swaywm/wlroots#1759 rootston part to sway. Co-Authored-By: Leo Chen <leo881003@gmail.com>
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r--sway/input/seat.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 502bc0bc..c3eae65c 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -179,6 +179,7 @@ static void seat_send_focus(struct sway_node *node, struct sway_seat *seat) {
seat_keyboard_notify_enter(seat, view->surface);
seat_tablet_pads_notify_enter(seat, view->surface);
+ sway_input_method_relay_set_focus(&seat->im_relay, view->surface);
struct wlr_pointer_constraint_v1 *constraint =
wlr_pointer_constraints_v1_constraint_for_surface(
@@ -562,6 +563,8 @@ struct sway_seat *seat_create(const char *seat_name) {
wl_list_init(&seat->keyboard_groups);
wl_list_init(&seat->keyboard_shortcuts_inhibitors);
+ sway_input_method_relay_init(seat, &seat->im_relay);
+
wl_list_insert(&server.input->seats, &seat->link);
seatop_begin_default(seat);
@@ -1015,6 +1018,7 @@ void seat_set_focus(struct sway_seat *seat, struct sway_node *node) {
view_close_popups(last_focus->sway_container->view);
}
seat_send_unfocus(last_focus, seat);
+ sway_input_method_relay_set_focus(&seat->im_relay, NULL);
seat->has_focus = false;
return;
}