aboutsummaryrefslogtreecommitdiff
path: root/rootston/keyboard.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-11-17 12:45:07 +0100
committeremersion <contact@emersion.fr>2017-11-17 12:45:07 +0100
commitbb6d34e7a5e270c6998f95f45c1e518d9c053714 (patch)
tree4c3a34eb809203e76c63ac90239f6d07312cc0f5 /rootston/keyboard.c
parent10f3be73843250c400531873b4dd27dba44919fd (diff)
rootston: add per-seat views
Diffstat (limited to 'rootston/keyboard.c')
-rw-r--r--rootston/keyboard.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/rootston/keyboard.c b/rootston/keyboard.c
index 39f46a32..d16d2b75 100644
--- a/rootston/keyboard.c
+++ b/rootston/keyboard.c
@@ -87,19 +87,20 @@ static const char *exec_prefix = "exec ";
static void keyboard_binding_execute(struct roots_keyboard *keyboard,
const char *command) {
- struct roots_server *server = keyboard->input->server;
+ struct roots_seat *seat = keyboard->seat;
if (strcmp(command, "exit") == 0) {
- wl_display_terminate(server->wl_display);
+ wl_display_terminate(keyboard->input->server->wl_display);
} else if (strcmp(command, "close") == 0) {
- if (server->desktop->views->length > 0) {
- struct roots_view *view =
- server->desktop->views->items[server->desktop->views->length-1];
- view_close(view);
+ 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);
}
} else if (strcmp(command, "next_window") == 0) {
- if (server->desktop->views->length > 0) {
- struct roots_view *view = server->desktop->views->items[0];
- roots_seat_focus_view(keyboard->seat, view);
+ if (!wl_list_empty(&seat->views)) {
+ struct roots_seat_view *last_seat_view = wl_container_of(
+ seat->views.prev, last_seat_view, link);
+ roots_seat_focus_view(seat, last_seat_view->view);
}
} else if (strncmp(exec_prefix, command, strlen(exec_prefix)) == 0) {
const char *shell_cmd = command + strlen(exec_prefix);