mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
Implement key binds to control virtual outputs (#1287)
Add actions `VirtualOutputAdd` and `VirtualOutputRemove`
This commit is contained in:
parent
e303281333
commit
111b955b53
5 changed files with 150 additions and 1 deletions
18
src/server.c
18
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,22 @@ 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, "unable to create headless backend");
|
||||
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 overlaid 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