summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sway/commands/input/xkb_layout.c4
-rw-r--r--sway/commands/input/xkb_model.c4
-rw-r--r--sway/commands/input/xkb_options.c4
-rw-r--r--sway/commands/input/xkb_rules.c4
-rw-r--r--sway/commands/input/xkb_variant.c4
-rw-r--r--sway/desktop/wl_shell.c2
-rw-r--r--sway/desktop/xdg_shell_v6.c2
-rw-r--r--sway/desktop/xwayland.c2
-rw-r--r--sway/input/input-manager.c29
-rw-r--r--sway/input/keyboard.c2
10 files changed, 21 insertions, 36 deletions
diff --git a/sway/commands/input/xkb_layout.c b/sway/commands/input/xkb_layout.c
index 4fc33e0b..a25d3850 100644
--- a/sway/commands/input/xkb_layout.c
+++ b/sway/commands/input/xkb_layout.c
@@ -18,8 +18,8 @@ struct cmd_results *input_cmd_xkb_layout(int argc, char **argv) {
18 18
19 new_config->xkb_layout = strdup(argv[0]); 19 new_config->xkb_layout = strdup(argv[0]);
20 20
21 sway_log(L_DEBUG, "apply-xkb_layout for device: %s", 21 sway_log(L_DEBUG, "apply-xkb_layout for device: %s layout: %s",
22 current_input_config->identifier); 22 current_input_config->identifier, new_config->xkb_layout);
23 apply_input_config(new_config); 23 apply_input_config(new_config);
24 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 24 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
25} 25}
diff --git a/sway/commands/input/xkb_model.c b/sway/commands/input/xkb_model.c
index 338bd7de..9729e869 100644
--- a/sway/commands/input/xkb_model.c
+++ b/sway/commands/input/xkb_model.c
@@ -18,8 +18,8 @@ struct cmd_results *input_cmd_xkb_model(int argc, char **argv) {
18 18
19 new_config->xkb_model = strdup(argv[0]); 19 new_config->xkb_model = strdup(argv[0]);
20 20
21 sway_log(L_DEBUG, "apply-xkb_model for device: %s", 21 sway_log(L_DEBUG, "apply-xkb_model for device: %s model: %s",
22 current_input_config->identifier); 22 current_input_config->identifier, new_config->xkb_model);
23 apply_input_config(new_config); 23 apply_input_config(new_config);
24 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 24 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
25} 25}
diff --git a/sway/commands/input/xkb_options.c b/sway/commands/input/xkb_options.c
index b24c33c1..504849cc 100644
--- a/sway/commands/input/xkb_options.c
+++ b/sway/commands/input/xkb_options.c
@@ -18,8 +18,8 @@ struct cmd_results *input_cmd_xkb_options(int argc, char **argv) {
18 18
19 new_config->xkb_options = strdup(argv[0]); 19 new_config->xkb_options = strdup(argv[0]);
20 20
21 sway_log(L_DEBUG, "apply-xkb_options for device: %s", 21 sway_log(L_DEBUG, "apply-xkb_options for device: %s options: %s",
22 current_input_config->identifier); 22 current_input_config->identifier, new_config->xkb_options);
23 apply_input_config(new_config); 23 apply_input_config(new_config);
24 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 24 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
25} 25}
diff --git a/sway/commands/input/xkb_rules.c b/sway/commands/input/xkb_rules.c
index def614e9..db7d8abe 100644
--- a/sway/commands/input/xkb_rules.c
+++ b/sway/commands/input/xkb_rules.c
@@ -18,8 +18,8 @@ struct cmd_results *input_cmd_xkb_rules(int argc, char **argv) {
18 18
19 new_config->xkb_rules = strdup(argv[0]); 19 new_config->xkb_rules = strdup(argv[0]);
20 20
21 sway_log(L_DEBUG, "apply-xkb_rules for device: %s", 21 sway_log(L_DEBUG, "apply-xkb_rules for device: %s rules: %s",
22 current_input_config->identifier); 22 current_input_config->identifier, new_config->xkb_rules);
23 apply_input_config(new_config); 23 apply_input_config(new_config);
24 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 24 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
25} 25}
diff --git a/sway/commands/input/xkb_variant.c b/sway/commands/input/xkb_variant.c
index cc135cce..855e6abc 100644
--- a/sway/commands/input/xkb_variant.c
+++ b/sway/commands/input/xkb_variant.c
@@ -18,8 +18,8 @@ struct cmd_results *input_cmd_xkb_variant(int argc, char **argv) {
18 18
19 new_config->xkb_variant = strdup(argv[0]); 19 new_config->xkb_variant = strdup(argv[0]);
20 20
21 sway_log(L_DEBUG, "apply-xkb_variant for device: %s", 21 sway_log(L_DEBUG, "apply-xkb_variant for device: %s variant: %s",
22 current_input_config->identifier); 22 current_input_config->identifier, new_config->xkb_variant);
23 apply_input_config(new_config); 23 apply_input_config(new_config);
24 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 24 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
25} 25}
diff --git a/sway/desktop/wl_shell.c b/sway/desktop/wl_shell.c
index df81d5be..e7150bf3 100644
--- a/sway/desktop/wl_shell.c
+++ b/sway/desktop/wl_shell.c
@@ -55,8 +55,6 @@ static void handle_commit(struct wl_listener *listener, void *data) {
55 struct sway_wl_shell_surface *sway_surface = 55 struct sway_wl_shell_surface *sway_surface =
56 wl_container_of(listener, sway_surface, commit); 56 wl_container_of(listener, sway_surface, commit);
57 struct sway_view *view = sway_surface->view; 57 struct sway_view *view = sway_surface->view;
58 sway_log(L_DEBUG, "wl_shell surface commit %dx%d",
59 sway_surface->pending_width, sway_surface->pending_height);
60 // NOTE: We intentionally discard the view's desired width here 58 // NOTE: We intentionally discard the view's desired width here
61 // TODO: Let floating views do whatever 59 // TODO: Let floating views do whatever
62 view->width = sway_surface->pending_width; 60 view->width = sway_surface->pending_width;
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c
index 82775e2f..015cc9d0 100644
--- a/sway/desktop/xdg_shell_v6.c
+++ b/sway/desktop/xdg_shell_v6.c
@@ -61,8 +61,6 @@ static void handle_commit(struct wl_listener *listener, void *data) {
61 struct sway_xdg_surface_v6 *sway_surface = 61 struct sway_xdg_surface_v6 *sway_surface =
62 wl_container_of(listener, sway_surface, commit); 62 wl_container_of(listener, sway_surface, commit);
63 struct sway_view *view = sway_surface->view; 63 struct sway_view *view = sway_surface->view;
64 sway_log(L_DEBUG, "xdg surface commit %dx%d",
65 sway_surface->pending_width, sway_surface->pending_height);
66 // NOTE: We intentionally discard the view's desired width here 64 // NOTE: We intentionally discard the view's desired width here
67 // TODO: Let floating views do whatever 65 // TODO: Let floating views do whatever
68 view->width = sway_surface->pending_width; 66 view->width = sway_surface->pending_width;
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index 29bed955..42e82c64 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -84,8 +84,6 @@ static void handle_commit(struct wl_listener *listener, void *data) {
84 struct sway_xwayland_surface *sway_surface = 84 struct sway_xwayland_surface *sway_surface =
85 wl_container_of(listener, sway_surface, commit); 85 wl_container_of(listener, sway_surface, commit);
86 struct sway_view *view = sway_surface->view; 86 struct sway_view *view = sway_surface->view;
87 sway_log(L_DEBUG, "xwayland surface commit %dx%d",
88 sway_surface->pending_width, sway_surface->pending_height);
89 // NOTE: We intentionally discard the view's desired width here 87 // NOTE: We intentionally discard the view's desired width here
90 // TODO: Let floating views do whatever 88 // TODO: Let floating views do whatever
91 view->width = sway_surface->pending_width; 89 view->width = sway_surface->pending_width;
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c
index 12a66917..52da8f5e 100644
--- a/sway/input/input-manager.c
+++ b/sway/input/input-manager.c
@@ -83,17 +83,6 @@ static struct sway_input_device *input_sway_device_from_wlr(
83 return NULL; 83 return NULL;
84} 84}
85 85
86static struct sway_input_device *input_sway_device_from_config(
87 struct sway_input_manager *input, struct input_config *config) {
88 struct sway_input_device *input_device = NULL;
89 wl_list_for_each(input_device, &input->devices, link) {
90 if (strcmp(input_device->identifier, config->identifier) == 0) {
91 return input_device;
92 }
93 }
94 return NULL;
95}
96
97static bool input_has_seat_configuration(struct sway_input_manager *input) { 86static bool input_has_seat_configuration(struct sway_input_manager *input) {
98 struct sway_seat *seat = NULL; 87 struct sway_seat *seat = NULL;
99 wl_list_for_each(seat, &input->seats, link) { 88 wl_list_for_each(seat, &input->seats, link) {
@@ -238,16 +227,16 @@ void sway_input_manager_set_focus(struct sway_input_manager *input,
238 227
239void sway_input_manager_apply_input_config(struct sway_input_manager *input, 228void sway_input_manager_apply_input_config(struct sway_input_manager *input,
240 struct input_config *input_config) { 229 struct input_config *input_config) {
241 struct sway_input_device *input_device = 230 struct sway_input_device *input_device = NULL;
242 input_sway_device_from_config(input, input_config); 231 wl_list_for_each(input_device, &input->devices, link) {
243 if (!input_device) { 232 if (strcmp(input_device->identifier, input_config->identifier) == 0) {
244 return; 233 input_device->config = input_config;
245 }
246 input_device->config = input_config;
247 234
248 struct sway_seat *seat = NULL; 235 struct sway_seat *seat = NULL;
249 wl_list_for_each(seat, &input->seats, link) { 236 wl_list_for_each(seat, &input->seats, link) {
250 sway_seat_configure_device(seat, input_device); 237 sway_seat_configure_device(seat, input_device);
238 }
239 }
251 } 240 }
252} 241}
253 242
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c
index ce0df3c5..bb18edd2 100644
--- a/sway/input/keyboard.c
+++ b/sway/input/keyboard.c
@@ -91,6 +91,8 @@ void sway_keyboard_configure(struct sway_keyboard *keyboard) {
91 wlr_keyboard_set_keymap(wlr_device->keyboard, keyboard->keymap); 91 wlr_keyboard_set_keymap(wlr_device->keyboard, keyboard->keymap);
92 wlr_keyboard_set_repeat_info(wlr_device->keyboard, 25, 600); 92 wlr_keyboard_set_repeat_info(wlr_device->keyboard, 25, 600);
93 xkb_context_unref(context); 93 xkb_context_unref(context);
94 struct wlr_seat *seat = keyboard->seat_device->sway_seat->wlr_seat;
95 wlr_seat_set_keyboard(seat, wlr_device);
94 96
95 wl_list_remove(&keyboard->keyboard_key.link); 97 wl_list_remove(&keyboard->keyboard_key.link);
96 wl_signal_add(&wlr_device->keyboard->events.key, &keyboard->keyboard_key); 98 wl_signal_add(&wlr_device->keyboard->events.key, &keyboard->keyboard_key);