aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/keyboard.c
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2018-01-20 14:10:11 -0500
committerLibravatar Tony Crisci <tony@dubstepdish.com>2018-01-20 14:10:11 -0500
commitc353e01c85049cfbc09510657e453b6aa5fd9c2d (patch)
treec6ef14cfc08861ff8c62675ca1fbbbb00e9197cf /sway/input/keyboard.c
parentseat config handler context (diff)
downloadsway-c353e01c85049cfbc09510657e453b6aa5fd9c2d.tar.gz
sway-c353e01c85049cfbc09510657e453b6aa5fd9c2d.tar.zst
sway-c353e01c85049cfbc09510657e453b6aa5fd9c2d.zip
add kill command
Diffstat (limited to 'sway/input/keyboard.c')
-rw-r--r--sway/input/keyboard.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c
index 5827a1ca..6dc57d46 100644
--- a/sway/input/keyboard.c
+++ b/sway/input/keyboard.c
@@ -89,9 +89,12 @@ static bool binding_matches_key_state(struct sway_binding *binding,
89 return false; 89 return false;
90} 90}
91 91
92static void binding_execute_command(struct sway_binding *binding) { 92static void keyboard_execute_command(struct sway_keyboard *keyboard,
93 struct sway_binding *binding) {
93 wlr_log(L_DEBUG, "running command for binding: %s", 94 wlr_log(L_DEBUG, "running command for binding: %s",
94 binding->command); 95 binding->command);
96 config_clear_handler_context(config);
97 config->handler_context.seat = keyboard->seat_device->sway_seat;
95 struct cmd_results *results = handle_command(binding->command); 98 struct cmd_results *results = handle_command(binding->command);
96 if (results->status != CMD_SUCCESS) { 99 if (results->status != CMD_SUCCESS) {
97 wlr_log(L_DEBUG, "could not run command for binding: %s", 100 wlr_log(L_DEBUG, "could not run command for binding: %s",
@@ -160,7 +163,7 @@ static bool keyboard_execute_bindsym(struct sway_keyboard *keyboard,
160 } 163 }
161 164
162 if (match) { 165 if (match) {
163 binding_execute_command(binding); 166 keyboard_execute_command(keyboard, binding);
164 return true; 167 return true;
165 } 168 }
166 } 169 }
@@ -267,7 +270,7 @@ static bool keyboard_execute_bindcode(struct sway_keyboard *keyboard,
267 for (int i = 0; i < keycode_bindings->length; ++i) { 270 for (int i = 0; i < keycode_bindings->length; ++i) {
268 struct sway_binding *binding = keycode_bindings->items[i]; 271 struct sway_binding *binding = keycode_bindings->items[i];
269 if (binding_matches_keycodes(wlr_keyboard, binding, event)) { 272 if (binding_matches_keycodes(wlr_keyboard, binding, event)) {
270 binding_execute_command(binding); 273 keyboard_execute_command(keyboard, binding);
271 return true; 274 return true;
272 } 275 }
273 } 276 }