Add support for closing windows

This commit is contained in:
project-repo 2020-08-25 15:15:31 +02:00
commit 73e8db1fa3
6 changed files with 29 additions and 0 deletions

View file

@ -549,6 +549,11 @@ keybinding_split_output(struct cg_output *output, bool vertical) {
}
}
static void
keybinding_close_view(struct cg_view *view) {
view->impl->close(view);
}
static void
keybinding_split_vertical(struct cg_server *server) {
keybinding_split_output(server->curr_output, true);
@ -964,6 +969,9 @@ run_action(enum keybinding_action action, struct cg_server *server,
case KEYBINDING_CONFIGURE_OUTPUT:
keybinding_configure_output(server, data.o_cfg);
break;
case KEYBINDING_CLOSE_VIEW:
keybinding_close_view(server->curr_output->workspaces[server->curr_output->curr_workspace]->focused_tile->view);
break;
default: {
wlr_log(WLR_ERROR,
"run_action was called with a value not present in \"enum "