mirror of
https://github.com/labwc/labwc.git
synced 2026-04-12 08:21:13 -04:00
Implement key binds to control virtual outputs
It is now possible to use keybinds to add and remove virtual outputs (also called headless backend in wlroots terminology).
This commit is contained in:
parent
5d2f594626
commit
45012d322a
5 changed files with 149 additions and 1 deletions
20
src/server.c
20
src/server.c
|
|
@ -3,6 +3,8 @@
|
|||
#include "config.h"
|
||||
#include <signal.h>
|
||||
#include <sys/wait.h>
|
||||
#include <wlr/backend/headless.h>
|
||||
#include <wlr/backend/multi.h>
|
||||
#include <wlr/types/wlr_data_control_v1.h>
|
||||
#include <wlr/types/wlr_export_dmabuf_v1.h>
|
||||
#include <wlr/types/wlr_fractional_scale_v1.h>
|
||||
|
|
@ -256,6 +258,24 @@ server_init(struct server *server)
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Create headless backend to enable adding virtual outputs later on.
|
||||
*/
|
||||
server->headless.backend = wlr_headless_backend_create(server->wl_display);
|
||||
if (!server->headless.backend) {
|
||||
wlr_log(WLR_ERROR, "failed to create virtual output");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
wlr_multi_backend_add(server->backend, server->headless.backend);
|
||||
|
||||
/*
|
||||
* If we don't populate headless backend with a virtual output (that we
|
||||
* create and immediately destroy), then virtual outputs being added
|
||||
* later do not work properly when overlayed on real output. Content is
|
||||
* drawn on the virtual output, but not drawn on the real output.
|
||||
*/
|
||||
wlr_output_destroy(wlr_headless_add_output(server->headless.backend, 0, 0));
|
||||
|
||||
/*
|
||||
* Autocreates a renderer, either Pixman, GLES2 or Vulkan for us. The
|
||||
* user can also specify a renderer using the WLR_RENDERER env var.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue