From 8dabd05195463f3b3f13258c548f55ea92a1cf43 Mon Sep 17 00:00:00 2001 From: itycodes Date: Sun, 27 Oct 2024 07:40:53 +0100 Subject: [PATCH] Implementations of the screencopy extensions The foreign toplevel implementation is incomplete --- include/sway/server.h | 3 ++- protocols/meson.build | 4 ++-- sway/server.c | 11 ++++++----- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/include/sway/server.h b/include/sway/server.h index 59fc0a6e..312e0adf 100644 --- a/include/sway/server.h +++ b/include/sway/server.h @@ -106,7 +106,8 @@ struct sway_server { struct wlr_content_type_manager_v1 *content_type_manager_v1; struct wlr_data_control_manager_v1 *data_control_manager_v1; struct wlr_screencopy_manager_v1 *screencopy_manager_v1; - struct wlr_ext_screencopy_manager_v1 *ext_screencopy_manager_v1; + struct wlr_ext_output_image_capture_source_manager_v1 *ext_output_image_source_manager_v1; + struct wlr_ext_image_copy_capture_manager_v1 *ext_image_copy_capture_manager_v1; struct wlr_export_dmabuf_manager_v1 *export_dmabuf_manager_v1; struct wlr_security_context_manager_v1 *security_context_manager_v1; diff --git a/protocols/meson.build b/protocols/meson.build index e2f3d58d..07d113b0 100644 --- a/protocols/meson.build +++ b/protocols/meson.build @@ -16,8 +16,8 @@ protocols = [ wl_protocol_dir / 'staging/cursor-shape/cursor-shape-v1.xml', wl_protocol_dir / 'staging/tearing-control/tearing-control-v1.xml', wl_protocol_dir / 'staging/ext-foreign-toplevel-list/ext-foreign-toplevel-list-v1.xml', - wl_protocol_dir / 'staging/ext-image-source/ext-image-source-v1.xml', - wl_protocol_dir / 'staging/ext-screencopy/ext-screencopy-v1.xml', + wl_protocol_dir / 'staging/ext-image-capture-source/ext-image-capture-source-v1.xml', + wl_protocol_dir / 'staging/ext-image-copy-capture/ext-image-copy-capture-v1.xml', 'wlr-layer-shell-unstable-v1.xml', 'idle.xml', 'wlr-output-power-management-unstable-v1.xml', diff --git a/sway/server.c b/sway/server.c index 74174fc9..aa10f0ba 100644 --- a/sway/server.c +++ b/sway/server.c @@ -19,8 +19,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -109,7 +109,8 @@ static bool is_privileged(const struct wl_global *global) { global == server.foreign_toplevel_manager->global || global == server.data_control_manager_v1->global || global == server.screencopy_manager_v1->global || - global == server.ext_screencopy_manager_v1->global || + global == server.ext_image_copy_capture_manager_v1->global || + global == server.ext_output_image_source_manager_v1->global || global == server.export_dmabuf_manager_v1->global || global == server.security_context_manager_v1->global || global == server.gamma_control_manager_v1->global || @@ -372,8 +373,8 @@ bool server_init(struct sway_server *server) { server->export_dmabuf_manager_v1 = wlr_export_dmabuf_manager_v1_create(server->wl_display); server->screencopy_manager_v1 = wlr_screencopy_manager_v1_create(server->wl_display); - server->ext_screencopy_manager_v1 = wlr_ext_screencopy_manager_v1_create(server->wl_display, 1); - wlr_ext_output_image_source_manager_v1_create(server->wl_display, 1); + server->ext_output_image_source_manager_v1 = wlr_ext_output_image_capture_source_manager_v1_create(server->wl_display, 1); + server->ext_image_copy_capture_manager_v1 = wlr_ext_image_copy_capture_manager_v1_create(server->wl_display, 1); server->data_control_manager_v1 = wlr_data_control_manager_v1_create(server->wl_display); server->security_context_manager_v1 = wlr_security_context_manager_v1_create(server->wl_display); wlr_viewporter_create(server->wl_display);