backend/wayland: add scaling support for output layers

Use the viewporter protocol to scale output layers.
This commit is contained in:
Simon Ser 2023-04-20 10:31:22 +02:00 committed by Alexander Orzechowski
parent 46a014bf47
commit 4c5eadecce
4 changed files with 27 additions and 2 deletions

View file

@ -29,6 +29,7 @@
#include "xdg-shell-client-protocol.h"
#include "tablet-unstable-v2-client-protocol.h"
#include "relative-pointer-unstable-v1-client-protocol.h"
#include "viewporter-client-protocol.h"
struct wlr_wl_linux_dmabuf_feedback_v1 {
struct wlr_wl_backend *backend;
@ -396,6 +397,9 @@ static void registry_global(void *data, struct wl_registry *registry,
} else if (strcmp(iface, wl_subcompositor_interface.name) == 0) {
wl->subcompositor = wl_registry_bind(registry, name,
&wl_subcompositor_interface, 1);
} else if (strcmp(iface, wp_viewporter_interface.name) == 0) {
wl->viewporter = wl_registry_bind(registry, name,
&wp_viewporter_interface, 1);
}
}
@ -515,6 +519,9 @@ static void backend_destroy(struct wlr_backend *backend) {
if (wl->subcompositor) {
wl_subcompositor_destroy(wl->subcompositor);
}
if (wl->viewporter) {
wp_viewporter_destroy(wl->viewporter);
}
free(wl->drm_render_name);
free(wl->activation_token);
xdg_wm_base_destroy(wl->xdg_wm_base);