aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2017-12-17 08:30:20 -0500
committerLibravatar Tony Crisci <tony@dubstepdish.com>2017-12-17 08:30:20 -0500
commite27eff8a29abd74448322ae78baa99a489e43620 (patch)
tree8ad1ad5998604a9e44c3cbd642a3b1921116b7fd /sway/input
parentset keyboard config at runtime (diff)
downloadsway-e27eff8a29abd74448322ae78baa99a489e43620.tar.gz
sway-e27eff8a29abd74448322ae78baa99a489e43620.tar.zst
sway-e27eff8a29abd74448322ae78baa99a489e43620.zip
send keyboard enter on keyboard configuration
Diffstat (limited to 'sway/input')
-rw-r--r--sway/input/input-manager.c2
-rw-r--r--sway/input/seat.c9
2 files changed, 9 insertions, 2 deletions
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c
index 6a49b13b..fa8e4b49 100644
--- a/sway/input/input-manager.c
+++ b/sway/input/input-manager.c
@@ -145,6 +145,7 @@ static void input_add_notify(struct wl_listener *listener, void *data) {
145 145
146 struct sway_seat *seat = NULL; 146 struct sway_seat *seat = NULL;
147 if (!input_has_seat_configuration(input)) { 147 if (!input_has_seat_configuration(input)) {
148 sway_log(L_DEBUG, "no seat configuration, using default seat");
148 seat = input_manager_get_seat(input, default_seat); 149 seat = input_manager_get_seat(input, default_seat);
149 sway_seat_add_device(seat, input_device); 150 sway_seat_add_device(seat, input_device);
150 return; 151 return;
@@ -245,6 +246,7 @@ void sway_input_manager_apply_input_config(struct sway_input_manager *input,
245 246
246void sway_input_manager_apply_seat_config(struct sway_input_manager *input, 247void sway_input_manager_apply_seat_config(struct sway_input_manager *input,
247 struct seat_config *seat_config) { 248 struct seat_config *seat_config) {
249 sway_log(L_DEBUG, "applying new seat config for seat %s", seat_config->name);
248 struct sway_seat *seat = input_manager_get_seat(input, seat_config->name); 250 struct sway_seat *seat = input_manager_get_seat(input, seat_config->name);
249 // the old config is invalid so clear it 251 // the old config is invalid so clear it
250 sway_seat_set_config(seat, NULL); 252 sway_seat_set_config(seat, NULL);
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 1e62efa1..8fe82b46 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -68,6 +68,13 @@ static void seat_configure_keyboard(struct sway_seat *seat,
68 sway_keyboard_create(seat, seat_device); 68 sway_keyboard_create(seat, seat_device);
69 } 69 }
70 sway_keyboard_configure(seat_device->keyboard); 70 sway_keyboard_configure(seat_device->keyboard);
71 wlr_seat_set_keyboard(seat->wlr_seat,
72 seat_device->input_device->wlr_device);
73 if (seat->focus) {
74 // force notify reenter to pick up the new configuration
75 wlr_seat_keyboard_clear_focus(seat->wlr_seat);
76 wlr_seat_keyboard_notify_enter(seat->wlr_seat, seat->focus->sway_view->surface);
77 }
71} 78}
72 79
73static struct sway_seat_device *sway_seat_get_device(struct sway_seat *seat, 80static struct sway_seat_device *sway_seat_get_device(struct sway_seat *seat,
@@ -101,8 +108,6 @@ void sway_seat_configure_device(struct sway_seat *seat,
101 break; 108 break;
102 case WLR_INPUT_DEVICE_KEYBOARD: 109 case WLR_INPUT_DEVICE_KEYBOARD:
103 seat_configure_keyboard(seat, seat_device); 110 seat_configure_keyboard(seat, seat_device);
104 wlr_seat_set_keyboard(seat->wlr_seat,
105 seat_device->input_device->wlr_device);
106 break; 111 break;
107 case WLR_INPUT_DEVICE_TOUCH: 112 case WLR_INPUT_DEVICE_TOUCH:
108 case WLR_INPUT_DEVICE_TABLET_PAD: 113 case WLR_INPUT_DEVICE_TABLET_PAD: