mirror of
https://github.com/cage-kiosk/cage.git
synced 2025-10-29 05:40:19 -04:00
view_destroy: focus the previous view when closing the current
Fixes #4.
This commit is contained in:
parent
3ef0fc3867
commit
c848bafaed
1 changed files with 7 additions and 1 deletions
8
view.c
8
view.c
|
|
@ -102,9 +102,15 @@ view_destroy(struct cg_view *view)
|
|||
}
|
||||
free(view);
|
||||
|
||||
/* If this was our primary view, exit. */
|
||||
/* If this was our primary view, exit. Otherwise, focus the
|
||||
previous (i.e., next highest in the stack) view. Since
|
||||
we're still here, we know there is at least one view in the
|
||||
list. */
|
||||
if (terminate) {
|
||||
wl_display_terminate(server->wl_display);
|
||||
} else {
|
||||
struct cg_view *prev = wl_container_of(server->views.next, prev, link);
|
||||
seat_set_focus(server->seat, prev);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue