diff options
Diffstat (limited to 'sway/input/keyboard.c')
-rw-r--r-- | sway/input/keyboard.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c index ec149d06..ede38519 100644 --- a/sway/input/keyboard.c +++ b/sway/input/keyboard.c | |||
@@ -3,6 +3,7 @@ | |||
3 | #include <wlr/backend/multi.h> | 3 | #include <wlr/backend/multi.h> |
4 | #include <wlr/backend/session.h> | 4 | #include <wlr/backend/session.h> |
5 | #include <wlr/types/wlr_idle.h> | 5 | #include <wlr/types/wlr_idle.h> |
6 | #include "sway/desktop/transaction.h" | ||
6 | #include "sway/input/seat.h" | 7 | #include "sway/input/seat.h" |
7 | #include "sway/input/keyboard.h" | 8 | #include "sway/input/keyboard.h" |
8 | #include "sway/input/input-manager.h" | 9 | #include "sway/input/input-manager.h" |
@@ -108,7 +109,7 @@ static void get_active_binding(const struct sway_shortcut_state *state, | |||
108 | } | 109 | } |
109 | 110 | ||
110 | if (*current_binding && *current_binding != binding) { | 111 | if (*current_binding && *current_binding != binding) { |
111 | wlr_log(L_DEBUG, "encountered duplicate bindings %d and %d", | 112 | wlr_log(WLR_DEBUG, "encountered duplicate bindings %d and %d", |
112 | (*current_binding)->order, binding->order); | 113 | (*current_binding)->order, binding->order); |
113 | } else { | 114 | } else { |
114 | *current_binding = binding; | 115 | *current_binding = binding; |
@@ -122,12 +123,13 @@ static void get_active_binding(const struct sway_shortcut_state *state, | |||
122 | */ | 123 | */ |
123 | static void keyboard_execute_command(struct sway_keyboard *keyboard, | 124 | static void keyboard_execute_command(struct sway_keyboard *keyboard, |
124 | struct sway_binding *binding) { | 125 | struct sway_binding *binding) { |
125 | wlr_log(L_DEBUG, "running command for binding: %s", | 126 | wlr_log(WLR_DEBUG, "running command for binding: %s", |
126 | binding->command); | 127 | binding->command); |
127 | config->handler_context.seat = keyboard->seat_device->sway_seat; | 128 | config->handler_context.seat = keyboard->seat_device->sway_seat; |
128 | struct cmd_results *results = execute_command(binding->command, NULL); | 129 | struct cmd_results *results = execute_command(binding->command, NULL); |
130 | transaction_commit_dirty(); | ||
129 | if (results->status != CMD_SUCCESS) { | 131 | if (results->status != CMD_SUCCESS) { |
130 | wlr_log(L_DEBUG, "could not run command for binding: %s (%s)", | 132 | wlr_log(WLR_DEBUG, "could not run command for binding: %s (%s)", |
131 | binding->command, results->error); | 133 | binding->command, results->error); |
132 | } | 134 | } |
133 | free_cmd_results(results); | 135 | free_cmd_results(results); |
@@ -386,7 +388,7 @@ void sway_keyboard_configure(struct sway_keyboard *keyboard) { | |||
386 | xkb_keymap_new_from_names(context, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS); | 388 | xkb_keymap_new_from_names(context, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS); |
387 | 389 | ||
388 | if (!keymap) { | 390 | if (!keymap) { |
389 | wlr_log(L_DEBUG, "cannot configure keyboard: keymap does not exist"); | 391 | wlr_log(WLR_DEBUG, "cannot configure keyboard: keymap does not exist"); |
390 | xkb_context_unref(context); | 392 | xkb_context_unref(context); |
391 | return; | 393 | return; |
392 | } | 394 | } |
@@ -420,6 +422,9 @@ void sway_keyboard_destroy(struct sway_keyboard *keyboard) { | |||
420 | if (!keyboard) { | 422 | if (!keyboard) { |
421 | return; | 423 | return; |
422 | } | 424 | } |
425 | if (keyboard->keymap) { | ||
426 | xkb_keymap_unref(keyboard->keymap); | ||
427 | } | ||
423 | wl_list_remove(&keyboard->keyboard_key.link); | 428 | wl_list_remove(&keyboard->keyboard_key.link); |
424 | wl_list_remove(&keyboard->keyboard_modifiers.link); | 429 | wl_list_remove(&keyboard->keyboard_modifiers.link); |
425 | free(keyboard); | 430 | free(keyboard); |