Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • wlroots wlroots
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 345
    • Issues 345
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 138
    • Merge requests 138
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.

  • wlrootswlroots
  • wlrootswlroots
  • Merge requests
  • !3457

ext-screencopy-v1

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Andri Yngvason requested to merge andri/wlroots:ext-screencopy-v1 into master Feb 20, 2022
  • Overview 0
  • Commits 22
  • Pipelines 13
  • Changes 12

This is the second draft of the ext-screencopy-v1 protocol implementation.

Some things are not yet implemented, most notable of which is any sort of output transform handling with regard to cursor rendering.

The protocol PR is here: wayland/wayland-protocols!124, and a client implementation can be found here: https://github.com/any1/wayvnc/tree/ext-screencopy-v1

Previous implementation is here: https://github.com/swaywm/wlroots/pull/3320

Sway requires the following change for enabling the protocol:

diff --git a/sway/server.c b/sway/server.c
index 8de9f629..82a80de5 100644
--- a/sway/server.c
+++ b/sway/server.c
@@ -23,6 +23,7 @@
 #include <wlr/types/wlr_primary_selection_v1.h>
 #include <wlr/types/wlr_relative_pointer_v1.h>
 #include <wlr/types/wlr_screencopy_v1.h>
+#include <wlr/types/wlr_ext_screencopy_v1.h>
 #include <wlr/types/wlr_server_decoration.h>
 #include <wlr/types/wlr_subcompositor.h>
 #include <wlr/types/wlr_tablet_v2.h>
@@ -196,6 +197,7 @@ bool server_init(struct sway_server *server) {
 
 	wlr_export_dmabuf_manager_v1_create(server->wl_display);
 	wlr_screencopy_manager_v1_create(server->wl_display);
+	wlr_ext_screencopy_manager_v1_create(server->wl_display);
 	wlr_data_control_manager_v1_create(server->wl_display);
 	wlr_primary_selection_v1_device_manager_create(server->wl_display);
 	wlr_viewporter_create(server->wl_display);

For testing, it's useful to enable hardware cursors in the headless backend:

diff --git a/backend/headless/output.c b/backend/headless/output.c
index f03d6ee0..ef2362d7 100644
--- a/backend/headless/output.c
+++ b/backend/headless/output.c
@@ -73,6 +73,16 @@ static bool output_commit(struct wlr_output *wlr_output) {
 	return true;
 }
 
+static bool output_set_cursor(struct wlr_output *wlr_output,
+		struct wlr_buffer *wlr_buffer, int hotspot_x, int hotspot_y) {
+	return true;
+}
+
+static bool output_move_cursor(struct wlr_output *_output, int x, int y) {
+	// TODO: only return true if x == current x and y == current y
+	return true;
+}
+
 static void output_destroy(struct wlr_output *wlr_output) {
 	struct wlr_headless_output *output =
 		headless_output_from_output(wlr_output);
@@ -84,6 +94,8 @@ static void output_destroy(struct wlr_output *wlr_output) {
 static const struct wlr_output_impl output_impl = {
 	.destroy = output_destroy,
 	.commit = output_commit,
+	.set_cursor = output_set_cursor,
+	.move_cursor = output_move_cursor,
 };
 
 bool wlr_output_is_headless(struct wlr_output *wlr_output) {
Edited Jun 10, 2022 by Andri Yngvason
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: ext-screencopy-v1