Fully support multiple primary clients

This is the path we settled on in #24.

That is: any new toplevel window takes over the Cage display, hiding any
previous toplevels until it is closed. Only when the last toplevel is
closed, does Cage exit as well.
This commit is contained in:
Jente Hidskes 2019-01-12 17:52:38 +01:00
parent b0bd4e680d
commit b6024e982f
4 changed files with 8 additions and 18 deletions

4
view.c
View file

@ -112,17 +112,17 @@ void
view_destroy(struct cg_view *view)
{
struct cg_server *server = view->server;
bool terminate = view_is_primary(view);
if (view->wlr_surface != NULL) {
view_unmap(view);
}
free(view);
/* If this was our primary view, exit. Otherwise, focus the
/* If this was our last 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. */
bool terminate = wl_list_empty(&server->views);
if (terminate) {
wl_display_terminate(server->wl_display);
} else {