aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/seat.c
diff options
context:
space:
mode:
authorLibravatar xdavidwu <xdavidwuph@gmail.com>2019-10-18 18:57:17 +0800
committerLibravatar Simon Ser <contact@emersion.fr>2020-04-04 11:42:04 +0200
commit5886187c6ef56307f15be475dc62785faf32ef35 (patch)
tree535283eca78c9a4ea63f26d9a13c1df48fe2b2f6 /sway/input/seat.c
parentswapped hiding the cursor and sending a touch event as a more logical sequence (diff)
downloadsway-5886187c6ef56307f15be475dc62785faf32ef35.tar.gz
sway-5886187c6ef56307f15be475dc62785faf32ef35.tar.zst
sway-5886187c6ef56307f15be475dc62785faf32ef35.zip
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) {
179 179
180 seat_keyboard_notify_enter(seat, view->surface); 180 seat_keyboard_notify_enter(seat, view->surface);
181 seat_tablet_pads_notify_enter(seat, view->surface); 181 seat_tablet_pads_notify_enter(seat, view->surface);
182 sway_input_method_relay_set_focus(&seat->im_relay, view->surface);
182 183
183 struct wlr_pointer_constraint_v1 *constraint = 184 struct wlr_pointer_constraint_v1 *constraint =
184 wlr_pointer_constraints_v1_constraint_for_surface( 185 wlr_pointer_constraints_v1_constraint_for_surface(
@@ -562,6 +563,8 @@ struct sway_seat *seat_create(const char *seat_name) {
562 wl_list_init(&seat->keyboard_groups); 563 wl_list_init(&seat->keyboard_groups);
563 wl_list_init(&seat->keyboard_shortcuts_inhibitors); 564 wl_list_init(&seat->keyboard_shortcuts_inhibitors);
564 565
566 sway_input_method_relay_init(seat, &seat->im_relay);
567
565 wl_list_insert(&server.input->seats, &seat->link); 568 wl_list_insert(&server.input->seats, &seat->link);
566 569
567 seatop_begin_default(seat); 570 seatop_begin_default(seat);
@@ -1015,6 +1018,7 @@ void seat_set_focus(struct sway_seat *seat, struct sway_node *node) {
1015 view_close_popups(last_focus->sway_container->view); 1018 view_close_popups(last_focus->sway_container->view);
1016 } 1019 }
1017 seat_send_unfocus(last_focus, seat); 1020 seat_send_unfocus(last_focus, seat);
1021 sway_input_method_relay_set_focus(&seat->im_relay, NULL);
1018 seat->has_focus = false; 1022 seat->has_focus = false;
1019 return; 1023 return;
1020 } 1024 }