aboutsummaryrefslogtreecommitdiff
path: root/rootston/keyboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'rootston/keyboard.c')
-rw-r--r--rootston/keyboard.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/rootston/keyboard.c b/rootston/keyboard.c
index d16d2b75..b8c7aca6 100644
--- a/rootston/keyboard.c
+++ b/rootston/keyboard.c
@@ -91,10 +91,9 @@ static void keyboard_binding_execute(struct roots_keyboard *keyboard,
if (strcmp(command, "exit") == 0) {
wl_display_terminate(keyboard->input->server->wl_display);
} else if (strcmp(command, "close") == 0) {
- if (!wl_list_empty(&seat->views)) {
- struct roots_seat_view *first_seat_view = wl_container_of(
- seat->views.next, first_seat_view, link);
- view_close(first_seat_view->view);
+ struct roots_view *focus = roots_seat_get_focus(seat);
+ if (focus != NULL) {
+ view_close(focus);
}
} else if (strcmp(command, "next_window") == 0) {
if (!wl_list_empty(&seat->views)) {