aboutsummaryrefslogtreecommitdiff
path: root/rootston/seat.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-11-19 19:21:18 +0100
committeremersion <contact@emersion.fr>2017-11-19 19:21:18 +0100
commit97ddd2d1df439a5b074e4dfa2865479646b8f3a6 (patch)
treedcae2e3f61df151fcfa68031bfd9e0b5d61f8dcd /rootston/seat.c
parentbf41e7a794cf4bde3612ec23744400388b9d6756 (diff)
Add roots_seat_cycle_focus
Diffstat (limited to 'rootston/seat.c')
-rw-r--r--rootston/seat.c13
1 files changed, 11 insertions, 2 deletions
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;