mirror of
https://github.com/cage-kiosk/cage.git
synced 2026-04-09 08:21:23 -04:00
Don’t terminate display when no view is found
Some apps like RetroArch will quit and fork itself to switch modes (like from the menu to a loaded core). This means that for a very short period of time we have no view available for Wayland. Right now, Cage doesn’t actually exit when it does this terminate, so you get this kind of zombie child process that is running but not showing anything on the screen because there is no compositor. The solution I have here is to just keep Cage’s Wayland server running to avoid this issue. I’m open to other idea, but this seems sane to me. Perhaps an alternative is to check if the process is still alive when this happens, if not then we can do the quitting behavior. In addition, we could make this an option if some users don’t want this behavior.
This commit is contained in:
parent
cc1f975c44
commit
8edaa54faf
1 changed files with 0 additions and 12 deletions
12
view.c
12
view.c
|
|
@ -258,14 +258,6 @@ void
|
||||||
view_destroy(struct cg_view *view)
|
view_destroy(struct cg_view *view)
|
||||||
{
|
{
|
||||||
struct cg_server *server = view->server;
|
struct cg_server *server = view->server;
|
||||||
bool ever_been_mapped = true;
|
|
||||||
|
|
||||||
#if CAGE_HAS_XWAYLAND
|
|
||||||
if (view->type == CAGE_XWAYLAND_VIEW) {
|
|
||||||
struct cg_xwayland_view *xwayland_view = xwayland_view_from_view(view);
|
|
||||||
ever_been_mapped = xwayland_view->ever_been_mapped;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (view->wlr_surface != NULL) {
|
if (view->wlr_surface != NULL) {
|
||||||
view_unmap(view);
|
view_unmap(view);
|
||||||
|
|
@ -278,10 +270,6 @@ view_destroy(struct cg_view *view)
|
||||||
if (!empty) {
|
if (!empty) {
|
||||||
struct cg_view *prev = wl_container_of(server->views.next, prev, link);
|
struct cg_view *prev = wl_container_of(server->views.next, prev, link);
|
||||||
seat_set_focus(server->seat, prev);
|
seat_set_focus(server->seat, prev);
|
||||||
} else if (ever_been_mapped) {
|
|
||||||
/* The list is empty and the last view has been
|
|
||||||
mapped, so we can safely exit. */
|
|
||||||
wl_display_terminate(server->wl_display);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue