* 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.
* Remove "ever_been_mapped" from cg_wayland_view
The documentation for `wayland-server.h` says:
> Use of this header file is discouraged. Prefer including
> wayland-server-core.h instead, which does not include the server protocol
> header and as such only defines the library PI, excluding the deprecated API
> below.
See also
ca45f4490c (diff-b57e10fe0774258a6d21b22077001cff)
This was temporarily removed when introducing proper view abstractions.
Now that we have the cg_xwayland_view struct, we reintroduce this
workaround in its proper place.
This also fixes the previous workaround, which checked whether a view
was *currently* mapped and not if it *has ever* been mapped.
See #18, #19 and 443d955dfd.
With Cage becoming more popular since its mention on Phoronix and
therefore getting more use-cases than just my own project, add XWayland
support. The refactoring of 2cf40f7 makes this much easier. Note that
this is a no-cost addition for those of us not using XWayland as it is a
compile-time option that needs to be explicitly enabled by adding
`-Dxwayland=true` to your meson command.