aboutsummaryrefslogtreecommitdiff
path: root/rootston/keyboard.c
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2017-11-20 06:25:00 -0500
committerGitHub <noreply@github.com>2017-11-20 06:25:00 -0500
commit083fe4506b9a57353fdee36ad05252742cc6429f (patch)
tree0fca8bfca5123cc60ce99e2cf3d6746a5cc7f20c /rootston/keyboard.c
parente0bdc16a10449d3bdf4517b5a85a9d55085d97c7 (diff)
parent0191f3f711b642aa496204e770eaa0dc1914f26d (diff)
Merge pull request #427 from emersion/seat-views
rootston: add per-seat views
Diffstat (limited to 'rootston/keyboard.c')
-rw-r--r--rootston/keyboard.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/rootston/keyboard.c b/rootston/keyboard.c
index 39f46a32..f3fc9a85 100644
--- a/rootston/keyboard.c
+++ b/rootston/keyboard.c
@@ -87,20 +87,16 @@ 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);
+ struct roots_view *focus = roots_seat_get_focus(seat);
+ if (focus != NULL) {
+ view_close(focus);
}
} 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);
- }
+ roots_seat_cycle_focus(seat);
} else if (strncmp(exec_prefix, command, strlen(exec_prefix)) == 0) {
const char *shell_cmd = command + strlen(exec_prefix);
pid_t pid = fork();