mirror of
https://github.com/swaywm/sway.git
synced 2025-11-21 06:59:48 -05:00
add kill command
This commit is contained in:
parent
cc3c713889
commit
c353e01c85
11 changed files with 77 additions and 3 deletions
|
|
@ -369,3 +369,14 @@ void sway_input_manager_configure_xcursor(struct sway_input_manager *input) {
|
|||
sway_seat_configure_xcursor(seat);
|
||||
}
|
||||
}
|
||||
|
||||
struct sway_seat *sway_input_manager_get_default_seat(
|
||||
struct sway_input_manager *input) {
|
||||
struct sway_seat *seat = NULL;
|
||||
wl_list_for_each(seat, &input->seats, link) {
|
||||
if (strcmp(seat->wlr_seat->name, "seat0") == 0) {
|
||||
return seat;
|
||||
}
|
||||
}
|
||||
return seat;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,9 +89,12 @@ static bool binding_matches_key_state(struct sway_binding *binding,
|
|||
return false;
|
||||
}
|
||||
|
||||
static void binding_execute_command(struct sway_binding *binding) {
|
||||
static void keyboard_execute_command(struct sway_keyboard *keyboard,
|
||||
struct sway_binding *binding) {
|
||||
wlr_log(L_DEBUG, "running command for binding: %s",
|
||||
binding->command);
|
||||
config_clear_handler_context(config);
|
||||
config->handler_context.seat = keyboard->seat_device->sway_seat;
|
||||
struct cmd_results *results = handle_command(binding->command);
|
||||
if (results->status != CMD_SUCCESS) {
|
||||
wlr_log(L_DEBUG, "could not run command for binding: %s",
|
||||
|
|
@ -160,7 +163,7 @@ static bool keyboard_execute_bindsym(struct sway_keyboard *keyboard,
|
|||
}
|
||||
|
||||
if (match) {
|
||||
binding_execute_command(binding);
|
||||
keyboard_execute_command(keyboard, binding);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -267,7 +270,7 @@ static bool keyboard_execute_bindcode(struct sway_keyboard *keyboard,
|
|||
for (int i = 0; i < keycode_bindings->length; ++i) {
|
||||
struct sway_binding *binding = keycode_bindings->items[i];
|
||||
if (binding_matches_keycodes(wlr_keyboard, binding, event)) {
|
||||
binding_execute_command(binding);
|
||||
keyboard_execute_command(keyboard, binding);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue