From bb6d34e7a5e270c6998f95f45c1e518d9c053714 Mon Sep 17 00:00:00 2001 From: emersion Date: Fri, 17 Nov 2017 12:45:07 +0100 Subject: rootston: add per-seat views --- include/rootston/desktop.h | 3 ++- include/rootston/seat.h | 20 ++++++++++++++++---- include/rootston/view.h | 8 +++++--- 3 files changed, 23 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/rootston/desktop.h b/include/rootston/desktop.h index b809db43..12ab5898 100644 --- a/include/rootston/desktop.h +++ b/include/rootston/desktop.h @@ -23,7 +23,7 @@ struct roots_output { }; struct roots_desktop { - struct wlr_list *views; + struct wl_list views; // roots_view::link struct wl_list outputs; struct timespec last_frame; @@ -59,6 +59,7 @@ struct roots_desktop *desktop_create(struct roots_server *server, struct roots_config *config); void desktop_destroy(struct roots_desktop *desktop); +void view_init(struct roots_view *view, struct roots_desktop *desktop); void view_destroy(struct roots_view *view); struct roots_view *view_at(struct roots_desktop *desktop, double lx, double ly, struct wlr_surface **surface, double *sx, double *sy); diff --git a/include/rootston/seat.h b/include/rootston/seat.h index bef515a4..a8397d89 100644 --- a/include/rootston/seat.h +++ b/include/rootston/seat.h @@ -9,8 +9,7 @@ struct roots_drag_icon { struct wl_list link; // roots_seat::drag_icons bool mapped; - int32_t sx; - int32_t sy; + int32_t sx, sy; struct wl_listener surface_destroy; struct wl_listener surface_commit; @@ -20,10 +19,11 @@ struct roots_seat { struct roots_input *input; struct wlr_seat *seat; struct roots_cursor *cursor; - struct wl_list link; struct wl_list drag_icons; + struct wl_list link; - struct roots_view *focus; + struct wl_list views; // roots_seat_view::link + struct roots_seat_view *focus; struct wl_list keyboards; struct wl_list pointers; @@ -31,6 +31,14 @@ struct roots_seat { struct wl_list tablet_tools; }; +struct roots_seat_view { + struct roots_seat *seat; + struct roots_view *view; + struct wl_list link; // roots_seat::views + + struct wl_listener destroy; +}; + struct roots_pointer { struct roots_seat *seat; struct wlr_input_device *device; @@ -70,6 +78,10 @@ void roots_seat_add_device(struct roots_seat *seat, void roots_seat_remove_device(struct roots_seat *seat, struct wlr_input_device *device); +void roots_seat_add_view(struct roots_seat *seat, struct roots_view *view); + +void roots_seat_remove_view(struct roots_seat *seat, struct roots_view *view); + void roots_seat_configure_cursor(struct roots_seat *seat); void roots_seat_configure_xcursor(struct roots_seat *seat); diff --git a/include/rootston/view.h b/include/rootston/view.h index 99b4ed78..69034d60 100644 --- a/include/rootston/view.h +++ b/include/rootston/view.h @@ -9,7 +9,6 @@ struct roots_wl_shell_surface { struct roots_view *view; - // TODO: Maybe destroy listener should go in roots_view struct wl_listener destroy; struct wl_listener request_move; struct wl_listener request_resize; @@ -22,7 +21,6 @@ struct roots_wl_shell_surface { struct roots_xdg_surface_v6 { struct roots_view *view; - // TODO: Maybe destroy listener should go in roots_view struct wl_listener commit; struct wl_listener destroy; struct wl_listener request_move; @@ -33,7 +31,6 @@ struct roots_xdg_surface_v6 { struct roots_xwayland_surface { struct roots_view *view; - // TODO: Maybe destroy listener should go in roots_view struct wl_listener destroy; struct wl_listener request_configure; struct wl_listener request_move; @@ -51,6 +48,7 @@ enum roots_view_type { struct roots_view { struct roots_desktop *desktop; + struct wl_list link; // roots_desktop::views double x, y; float rotation; @@ -80,6 +78,10 @@ struct roots_view { }; struct wlr_surface *wlr_surface; + struct { + struct wl_signal destroy; + } events; + // TODO: This would probably be better as a field that's updated on a // configure event from the xdg_shell // If not then this should follow the typical type/impl pattern we use -- cgit v1.2.3 From a8b31da52c32a65793d6e941b869d5f2d6736775 Mon Sep 17 00:00:00 2001 From: emersion Date: Sun, 19 Nov 2017 18:15:11 +0100 Subject: Remove roots_seat_{add,remove}_view --- include/rootston/seat.h | 8 ++-- rootston/cursor.c | 25 ++++++----- rootston/desktop.c | 5 --- rootston/input.c | 2 +- rootston/seat.c | 113 ++++++++++++++++++++++++++---------------------- 5 files changed, 78 insertions(+), 75 deletions(-) (limited to 'include') diff --git a/include/rootston/seat.h b/include/rootston/seat.h index 609d0c74..14ba9224 100644 --- a/include/rootston/seat.h +++ b/include/rootston/seat.h @@ -15,7 +15,7 @@ struct roots_seat { double touch_x, touch_y; struct wl_list views; // roots_seat_view::link - struct roots_seat_view *focus; + bool has_focus; struct wl_list keyboards; struct wl_list pointers; @@ -63,16 +63,14 @@ void roots_seat_add_device(struct roots_seat *seat, void roots_seat_remove_device(struct roots_seat *seat, struct wlr_input_device *device); -void roots_seat_add_view(struct roots_seat *seat, struct roots_view *view); - -void roots_seat_remove_view(struct roots_seat *seat, struct roots_view *view); - void roots_seat_configure_cursor(struct roots_seat *seat); void roots_seat_configure_xcursor(struct roots_seat *seat); bool roots_seat_has_meta_pressed(struct roots_seat *seat); +struct roots_view *roots_seat_get_focused_view(struct roots_seat *seat); + void roots_seat_focus_view(struct roots_seat *seat, struct roots_view *view); void roots_seat_begin_move(struct roots_seat *seat, struct roots_view *view); diff --git a/rootston/cursor.c b/rootston/cursor.c index 7bb46692..046fd4f4 100644 --- a/rootston/cursor.c +++ b/rootston/cursor.c @@ -58,19 +58,21 @@ static void roots_cursor_update_position(struct roots_cursor *cursor, } break; case ROOTS_CURSOR_MOVE: - if (seat->focus) { + view = roots_seat_get_focused_view(seat); + if (view != NULL) { double dx = cursor->cursor->x - cursor->offs_x; double dy = cursor->cursor->y - cursor->offs_y; - view_move(seat->focus->view, cursor->view_x + dx, + view_move(view, cursor->view_x + dx, cursor->view_y + dy); } break; case ROOTS_CURSOR_RESIZE: - if (seat->focus) { + view = roots_seat_get_focused_view(seat); + if (view != NULL) { double dx = cursor->cursor->x - cursor->offs_x; double dy = cursor->cursor->y - cursor->offs_y; - double active_x = seat->focus->view->x; - double active_y = seat->focus->view->y; + double active_x = view->x; + double active_y = view->y; int width = cursor->view_width; int height = cursor->view_height; if (cursor->resize_edges & ROOTS_CURSOR_RESIZE_EDGE_TOP) { @@ -99,18 +101,18 @@ static void roots_cursor_update_position(struct roots_cursor *cursor, height = 0; } - if (active_x != seat->focus->view->x || - active_y != seat->focus->view->y) { - view_move_resize(seat->focus->view, active_x, active_y, + if (active_x != view->x || + active_y != view->y) { + view_move_resize(view, active_x, active_y, width, height); } else { - view_resize(seat->focus->view, width, height); + view_resize(view, width, height); } } break; case ROOTS_CURSOR_ROTATE: - if (seat->focus) { - struct roots_view *view = seat->focus->view; + view = roots_seat_get_focused_view(seat); + if (view != NULL) { int ox = view->x + view->wlr_surface->current->width/2, oy = view->y + view->wlr_surface->current->height/2; int ux = cursor->offs_x - ox, @@ -124,7 +126,6 @@ static void roots_cursor_update_position(struct roots_cursor *cursor, } break; } - } static void roots_cursor_press_button(struct roots_cursor *cursor, diff --git a/rootston/desktop.c b/rootston/desktop.c index aa924068..bea492ba 100644 --- a/rootston/desktop.c +++ b/rootston/desktop.c @@ -190,11 +190,6 @@ void view_init(struct roots_view *view, struct roots_desktop *desktop) { wl_signal_init(&view->events.destroy); wl_list_insert(&desktop->views, &view->link); - - struct roots_seat *seat; - wl_list_for_each(seat, &desktop->server->input->seats, link) { - roots_seat_add_view(seat, view); - } } void view_setup(struct roots_view *view) { diff --git a/rootston/input.c b/rootston/input.c index 9f779415..d698c952 100644 --- a/rootston/input.c +++ b/rootston/input.c @@ -116,7 +116,7 @@ bool input_view_has_focus(struct roots_input *input, struct roots_view *view) { } struct roots_seat *seat; wl_list_for_each(seat, &input->seats, link) { - if (seat->focus != NULL && seat->focus->view == view) { + if (view == roots_seat_get_focused_view(seat)) { return true; } } diff --git a/rootston/seat.c b/rootston/seat.c index 6df8cc44..d5844ea6 100644 --- a/rootston/seat.c +++ b/rootston/seat.c @@ -485,56 +485,20 @@ bool roots_seat_has_meta_pressed(struct roots_seat *seat) { return false; } -void roots_seat_focus_view(struct roots_seat *seat, struct roots_view *view) { - if (seat->focus != NULL && seat->focus->view == view) { - return; - } - - if (view && view->type == ROOTS_XWAYLAND_VIEW && - view->xwayland_surface->override_redirect) { - return; - } - - bool found = false; - struct roots_seat_view *seat_view; - wl_list_for_each(seat_view, &seat->views, link) { - if (seat_view->view == view) { - found = true; - break; - } - } - if (!found) { - return; - } - - struct roots_seat_view *prev_focus = seat->focus; - seat->focus = seat_view; - - // unfocus the old view if it is not focused by some other seat - if (prev_focus && !input_view_has_focus(seat->input, prev_focus->view)) { - view_activate(prev_focus->view, false); - } - - if (!seat->focus) { - seat->cursor->mode = ROOTS_CURSOR_PASSTHROUGH; - return; +struct roots_view *roots_seat_get_focused_view(struct roots_seat *seat) { + if (!seat->has_focus || wl_list_empty(&seat->views)) { + return NULL; } - - view_activate(view, true); - wl_list_remove(&seat_view->view->link); - wl_list_insert(&seat->input->server->desktop->views, - &seat_view->view->link); - - wl_list_remove(&seat_view->link); - wl_list_insert(&seat->views, &seat_view->link); - wlr_seat_keyboard_notify_enter(seat->seat, view->wlr_surface); + struct roots_seat_view *seat_view = + wl_container_of(seat->views.next, seat_view, link); + return seat_view->view; } static void seat_view_destroy(struct roots_seat_view *seat_view) { struct roots_seat *seat = seat_view->seat; - if (seat->focus == seat_view) { - seat->focus = NULL; + if (seat_view->view == roots_seat_get_focused_view(seat)) { + seat->has_focus = false; seat->cursor->mode = ROOTS_CURSOR_PASSTHROUGH; } @@ -556,11 +520,12 @@ static void seat_view_handle_destroy(struct wl_listener *listener, void *data) { seat_view_destroy(seat_view); } -void roots_seat_add_view(struct roots_seat *seat, struct roots_view *view) { +static struct roots_seat_view *seat_add_view(struct roots_seat *seat, + struct roots_view *view) { struct roots_seat_view *seat_view = calloc(1, sizeof(struct roots_seat_view)); if (seat_view == NULL) { - return; + return NULL; } seat_view->seat = seat; seat_view->view = view; @@ -569,16 +534,60 @@ void roots_seat_add_view(struct roots_seat *seat, struct roots_view *view) { seat_view->destroy.notify = seat_view_handle_destroy; wl_signal_add(&view->events.destroy, &seat_view->destroy); + + return seat_view; } -void roots_seat_remove_view(struct roots_seat *seat, struct roots_view *view) { - struct roots_seat_view *seat_view; - wl_list_for_each(seat_view, &seat->views, link) { - if (seat_view->view == view) { - seat_view_destroy(seat_view); - break; +void roots_seat_focus_view(struct roots_seat *seat, struct roots_view *view) { + struct roots_view *prev_focus = roots_seat_get_focused_view(seat); + if (view == prev_focus) { + return; + } + + if (view && view->type == ROOTS_XWAYLAND_VIEW && + view->xwayland_surface->override_redirect) { + return; + } + + struct roots_seat_view *seat_view = NULL; + if (view != NULL) { + bool found = false; + wl_list_for_each(seat_view, &seat->views, link) { + if (seat_view->view == view) { + found = true; + break; + } } + if (!found) { + seat_view = seat_add_view(seat, view); + if (seat_view == NULL) { + wlr_log(L_ERROR, "Allocation failed"); + return; + } + } + } + + seat->has_focus = false; + + // unfocus the old view if it is not focused by some other seat + if (prev_focus != NULL && !input_view_has_focus(seat->input, prev_focus)) { + view_activate(prev_focus, false); + } + + if (view == NULL) { + seat->cursor->mode = ROOTS_CURSOR_PASSTHROUGH; + return; } + + view_activate(view, true); + wl_list_remove(&seat_view->view->link); + wl_list_insert(&seat->input->server->desktop->views, + &seat_view->view->link); + + seat->has_focus = true; + wl_list_remove(&seat_view->link); + wl_list_insert(&seat->views, &seat_view->link); + wlr_seat_keyboard_notify_enter(seat->seat, view->wlr_surface); } void roots_seat_begin_move(struct roots_seat *seat, struct roots_view *view) { -- cgit v1.2.3 From bf41e7a794cf4bde3612ec23744400388b9d6756 Mon Sep 17 00:00:00 2001 From: emersion Date: Sun, 19 Nov 2017 19:14:31 +0100 Subject: Make the close command use roots_seat_get_focus, rename a few symbols --- include/rootston/seat.h | 4 ++-- rootston/cursor.c | 6 +++--- rootston/input.c | 2 +- rootston/keyboard.c | 7 +++---- rootston/seat.c | 16 ++++++++-------- 5 files changed, 17 insertions(+), 18 deletions(-) (limited to 'include') diff --git a/include/rootston/seat.h b/include/rootston/seat.h index 14ba9224..d9a44c2d 100644 --- a/include/rootston/seat.h +++ b/include/rootston/seat.h @@ -28,7 +28,7 @@ struct roots_seat_view { struct roots_view *view; struct wl_list link; // roots_seat::views - struct wl_listener destroy; + struct wl_listener view_destroy; }; struct roots_pointer { @@ -69,7 +69,7 @@ void roots_seat_configure_xcursor(struct roots_seat *seat); bool roots_seat_has_meta_pressed(struct roots_seat *seat); -struct roots_view *roots_seat_get_focused_view(struct roots_seat *seat); +struct roots_view *roots_seat_get_focus(struct roots_seat *seat); void roots_seat_focus_view(struct roots_seat *seat, struct roots_view *view); diff --git a/rootston/cursor.c b/rootston/cursor.c index 046fd4f4..3bb2a700 100644 --- a/rootston/cursor.c +++ b/rootston/cursor.c @@ -58,7 +58,7 @@ static void roots_cursor_update_position(struct roots_cursor *cursor, } break; case ROOTS_CURSOR_MOVE: - view = roots_seat_get_focused_view(seat); + view = roots_seat_get_focus(seat); if (view != NULL) { double dx = cursor->cursor->x - cursor->offs_x; double dy = cursor->cursor->y - cursor->offs_y; @@ -67,7 +67,7 @@ static void roots_cursor_update_position(struct roots_cursor *cursor, } break; case ROOTS_CURSOR_RESIZE: - view = roots_seat_get_focused_view(seat); + view = roots_seat_get_focus(seat); if (view != NULL) { double dx = cursor->cursor->x - cursor->offs_x; double dy = cursor->cursor->y - cursor->offs_y; @@ -111,7 +111,7 @@ static void roots_cursor_update_position(struct roots_cursor *cursor, } break; case ROOTS_CURSOR_ROTATE: - view = roots_seat_get_focused_view(seat); + view = roots_seat_get_focus(seat); if (view != NULL) { int ox = view->x + view->wlr_surface->current->width/2, oy = view->y + view->wlr_surface->current->height/2; diff --git a/rootston/input.c b/rootston/input.c index d698c952..ce20e840 100644 --- a/rootston/input.c +++ b/rootston/input.c @@ -116,7 +116,7 @@ bool input_view_has_focus(struct roots_input *input, struct roots_view *view) { } struct roots_seat *seat; wl_list_for_each(seat, &input->seats, link) { - if (view == roots_seat_get_focused_view(seat)) { + if (view == roots_seat_get_focus(seat)) { return true; } } 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)) { diff --git a/rootston/seat.c b/rootston/seat.c index d5844ea6..61399850 100644 --- a/rootston/seat.c +++ b/rootston/seat.c @@ -485,7 +485,7 @@ bool roots_seat_has_meta_pressed(struct roots_seat *seat) { return false; } -struct roots_view *roots_seat_get_focused_view(struct roots_seat *seat) { +struct roots_view *roots_seat_get_focus(struct roots_seat *seat) { if (!seat->has_focus || wl_list_empty(&seat->views)) { return NULL; } @@ -497,12 +497,12 @@ struct roots_view *roots_seat_get_focused_view(struct roots_seat *seat) { static void seat_view_destroy(struct roots_seat_view *seat_view) { struct roots_seat *seat = seat_view->seat; - if (seat_view->view == roots_seat_get_focused_view(seat)) { + if (seat_view->view == roots_seat_get_focus(seat)) { seat->has_focus = false; seat->cursor->mode = ROOTS_CURSOR_PASSTHROUGH; } - wl_list_remove(&seat_view->destroy.link); + wl_list_remove(&seat_view->view_destroy.link); wl_list_remove(&seat_view->link); free(seat_view); @@ -516,7 +516,7 @@ static void seat_view_destroy(struct roots_seat_view *seat_view) { static void seat_view_handle_destroy(struct wl_listener *listener, void *data) { struct roots_seat_view *seat_view = - wl_container_of(listener, seat_view, destroy); + wl_container_of(listener, seat_view, view_destroy); seat_view_destroy(seat_view); } @@ -532,14 +532,14 @@ static struct roots_seat_view *seat_add_view(struct roots_seat *seat, wl_list_insert(&seat->views, &seat_view->link); - seat_view->destroy.notify = seat_view_handle_destroy; - wl_signal_add(&view->events.destroy, &seat_view->destroy); + seat_view->view_destroy.notify = seat_view_handle_destroy; + wl_signal_add(&view->events.destroy, &seat_view->view_destroy); return seat_view; } void roots_seat_focus_view(struct roots_seat *seat, struct roots_view *view) { - struct roots_view *prev_focus = roots_seat_get_focused_view(seat); + struct roots_view *prev_focus = roots_seat_get_focus(seat); if (view == prev_focus) { return; } @@ -569,7 +569,7 @@ void roots_seat_focus_view(struct roots_seat *seat, struct roots_view *view) { seat->has_focus = false; - // unfocus the old view if it is not focused by some other seat + // deactivate the old view if it is not focused by some other seat if (prev_focus != NULL && !input_view_has_focus(seat->input, prev_focus)) { view_activate(prev_focus, false); } -- cgit v1.2.3 From 97ddd2d1df439a5b074e4dfa2865479646b8f3a6 Mon Sep 17 00:00:00 2001 From: emersion Date: Sun, 19 Nov 2017 19:21:18 +0100 Subject: Add roots_seat_cycle_focus --- include/rootston/seat.h | 4 +++- rootston/cursor.c | 4 ++-- rootston/desktop.c | 2 +- rootston/keyboard.c | 6 +----- rootston/seat.c | 13 +++++++++++-- 5 files changed, 18 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/rootston/seat.h b/include/rootston/seat.h index d9a44c2d..7822bb70 100644 --- a/include/rootston/seat.h +++ b/include/rootston/seat.h @@ -71,7 +71,9 @@ bool roots_seat_has_meta_pressed(struct roots_seat *seat); struct roots_view *roots_seat_get_focus(struct roots_seat *seat); -void roots_seat_focus_view(struct roots_seat *seat, struct roots_view *view); +void roots_seat_set_focus(struct roots_seat *seat, struct roots_view *view); + +void roots_seat_cycle_focus(struct roots_seat *seat); void roots_seat_begin_move(struct roots_seat *seat, struct roots_view *view); diff --git a/rootston/cursor.c b/rootston/cursor.c index 3bb2a700..71075aa9 100644 --- a/rootston/cursor.c +++ b/rootston/cursor.c @@ -142,7 +142,7 @@ static void roots_cursor_press_button(struct roots_cursor *cursor, if (state == WLR_BUTTON_PRESSED && view && roots_seat_has_meta_pressed(seat)) { - roots_seat_focus_view(seat, view); + roots_seat_set_focus(seat, view); uint32_t edges; switch (button) { @@ -193,7 +193,7 @@ static void roots_cursor_press_button(struct roots_cursor *cursor, cursor->input_events[i].device = device; cursor->input_events_idx = (i + 1) % (sizeof(cursor->input_events) / sizeof(cursor->input_events[0])); - roots_seat_focus_view(seat, view); + roots_seat_set_focus(seat, view); break; } } diff --git a/rootston/desktop.c b/rootston/desktop.c index bea492ba..cf5a8cdc 100644 --- a/rootston/desktop.c +++ b/rootston/desktop.c @@ -197,7 +197,7 @@ void view_setup(struct roots_view *view) { // TODO what seat gets focus? the one with the last input event? struct roots_seat *seat; wl_list_for_each(seat, &input->seats, link) { - roots_seat_focus_view(seat, view); + roots_seat_set_focus(seat, view); } view_center(view); diff --git a/rootston/keyboard.c b/rootston/keyboard.c index b8c7aca6..f3fc9a85 100644 --- a/rootston/keyboard.c +++ b/rootston/keyboard.c @@ -96,11 +96,7 @@ static void keyboard_binding_execute(struct roots_keyboard *keyboard, view_close(focus); } } else if (strcmp(command, "next_window") == 0) { - 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); - } + 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(); diff --git a/rootston/seat.c b/rootston/seat.c index 61399850..df6b8590 100644 --- a/rootston/seat.c +++ b/rootston/seat.c @@ -510,7 +510,7 @@ static void seat_view_destroy(struct roots_seat_view *seat_view) { if (!wl_list_empty(&seat->views)) { struct roots_seat_view *first_seat_view = wl_container_of( seat->views.next, first_seat_view, link); - roots_seat_focus_view(seat, first_seat_view->view); + roots_seat_set_focus(seat, first_seat_view->view); } } @@ -538,7 +538,7 @@ static struct roots_seat_view *seat_add_view(struct roots_seat *seat, return seat_view; } -void roots_seat_focus_view(struct roots_seat *seat, struct roots_view *view) { +void roots_seat_set_focus(struct roots_seat *seat, struct roots_view *view) { struct roots_view *prev_focus = roots_seat_get_focus(seat); if (view == prev_focus) { return; @@ -590,6 +590,15 @@ void roots_seat_focus_view(struct roots_seat *seat, struct roots_view *view) { wlr_seat_keyboard_notify_enter(seat->seat, view->wlr_surface); } +void roots_seat_cycle_focus(struct roots_seat *seat) { + if (wl_list_empty(&seat->views)) { + return; + } + struct roots_seat_view *last_seat_view = wl_container_of( + seat->views.prev, last_seat_view, link); + roots_seat_set_focus(seat, last_seat_view->view); +} + void roots_seat_begin_move(struct roots_seat *seat, struct roots_view *view) { struct roots_cursor *cursor = seat->cursor; cursor->mode = ROOTS_CURSOR_MOVE; -- cgit v1.2.3