Add screencopy

This commit is contained in:
Andri Yngvason 2019-08-16 16:46:51 +00:00 committed by Jente Hidskes
parent 69340921a4
commit da6b6c208e

10
cage.c
View file

@ -30,6 +30,7 @@
#endif
#include <wlr/types/wlr_xdg_decoration_v1.h>
#include <wlr/types/wlr_xdg_shell.h>
#include <wlr/types/wlr_screencopy_v1.h>
#include <wlr/util/log.h>
#if CAGE_HAS_XWAYLAND
#include <wlr/xwayland.h>
@ -169,6 +170,7 @@ main(int argc, char *argv[])
struct wlr_data_device_manager *data_device_mgr = NULL;
struct wlr_server_decoration_manager *server_decoration_manager = NULL;
struct wlr_xdg_decoration_manager_v1 *xdg_decoration_manager = NULL;
struct wlr_screencopy_manager_v1 *screencopy_manager = NULL;
struct wlr_xdg_shell *xdg_shell = NULL;
#if CAGE_HAS_XWAYLAND
struct wlr_xwayland *xwayland = NULL;
@ -293,6 +295,13 @@ main(int argc, char *argv[])
WLR_SERVER_DECORATION_MANAGER_MODE_SERVER :
WLR_SERVER_DECORATION_MANAGER_MODE_CLIENT);
screencopy_manager = wlr_screencopy_manager_v1_create(server.wl_display);
if (!screencopy_manager) {
wlr_log(WLR_ERROR, "Unable to create the screencopy manager");
ret = 1;
goto end;
}
#if CAGE_HAS_XWAYLAND
xwayland = wlr_xwayland_create(server.wl_display, compositor, true);
if (!xwayland) {
@ -374,6 +383,7 @@ end:
wl_event_source_remove(sigint_source);
wl_event_source_remove(sigterm_source);
seat_destroy(server.seat);
wlr_screencopy_manager_v1_destroy(screencopy_manager);
wlr_server_decoration_manager_destroy(server_decoration_manager);
wlr_xdg_decoration_manager_v1_destroy(xdg_decoration_manager);
wlr_xdg_shell_destroy(xdg_shell);