Add optional headless fallback output

This allows configuring a headless fallback output that
is automatically created whenever there is no other output
around. It is destroyed when a new output is discovered.

It can be enabled by setting the environment variable
LABWC_FALLBACK_OUTPUT to the desired output name.

The feature benefits applications like wayvnc the most
as there is always an output available to connect to.

Co-Authored-By: Simon Long <simon@raspberrypi.com>
This commit is contained in:
Consolatis 2024-03-07 02:11:46 +01:00
parent e00f7cd6db
commit 60aab98e8d
5 changed files with 63 additions and 1 deletions

View file

@ -24,6 +24,7 @@
#include "labwc.h"
#include "layers.h"
#include "node.h"
#include "output-virtual.h"
#include "regions.h"
#include "view.h"
#include "xwayland.h"
@ -694,6 +695,12 @@ handle_output_layout_change(struct wl_listener *listener, void *data)
{
struct server *server =
wl_container_of(listener, server, output_layout_change);
/* Prevents unnecessary layout recalculations */
server->pending_output_layout_change++;
output_virtual_update_fallback(server);
server->pending_output_layout_change--;
do_output_layout_change(server);
}