diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-09-19 08:01:38 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-19 08:01:38 -0400 |
commit | adbf21eb83da23f94c3d85a584f4d1c3465aa7f4 (patch) | |
tree | df27714d713c5937a692c7dd1f1b5b347f59081b /include | |
parent | 3693fae0c44d83cab2c701bd44b80d8f6242781e (diff) | |
parent | 3df602a62da5024bfa4e68f87355f789632973a1 (diff) |
Merge pull request #1245 from emersion/capture-disable-hw-cursors
Disable hardware cursors when capturing output
Diffstat (limited to 'include')
-rw-r--r-- | include/wlr/types/wlr_export_dmabuf_v1.h | 3 | ||||
-rw-r--r-- | include/wlr/types/wlr_output.h | 9 | ||||
-rw-r--r-- | include/wlr/types/wlr_screencopy_v1.h | 3 |
3 files changed, 15 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_export_dmabuf_v1.h b/include/wlr/types/wlr_export_dmabuf_v1.h index 56767540..8669574d 100644 --- a/include/wlr/types/wlr_export_dmabuf_v1.h +++ b/include/wlr/types/wlr_export_dmabuf_v1.h @@ -9,6 +9,7 @@ #ifndef WLR_TYPES_WLR_EXPORT_DMABUF_V1_H #define WLR_TYPES_WLR_EXPORT_DMABUF_V1_H +#include <stdbool.h> #include <wayland-server.h> #include <wlr/render/dmabuf.h> @@ -22,6 +23,8 @@ struct wlr_export_dmabuf_frame_v1 { struct wlr_dmabuf_attributes attribs; struct wlr_output *output; + bool cursor_locked; + struct wl_listener output_swap_buffers; }; diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h index ded57959..ecd4f759 100644 --- a/include/wlr/types/wlr_output.h +++ b/include/wlr/types/wlr_output.h @@ -107,6 +107,7 @@ struct wlr_output { struct wl_list cursors; // wlr_output_cursor::link struct wlr_output_cursor *hardware_cursor; + int software_cursor_locks; // number of locks forcing software cursors // the output position in layout space reported to clients int32_t lx, ly; @@ -196,6 +197,14 @@ bool wlr_output_export_dmabuf(struct wlr_output *output, void wlr_output_set_fullscreen_surface(struct wlr_output *output, struct wlr_surface *surface); struct wlr_output *wlr_output_from_resource(struct wl_resource *resource); +/** + * Locks the output to only use software cursors instead of hardware cursors. + * This is useful if hardware cursors need to be temporarily disabled (e.g. + * during screen capture). There must be as many unlocks as there have been + * locks to restore the original state. There should never be an unlock before + * a lock. + */ +void wlr_output_lock_software_cursors(struct wlr_output *output, bool lock); struct wlr_output_cursor *wlr_output_cursor_create(struct wlr_output *output); diff --git a/include/wlr/types/wlr_screencopy_v1.h b/include/wlr/types/wlr_screencopy_v1.h index aba32a45..c7197bab 100644 --- a/include/wlr/types/wlr_screencopy_v1.h +++ b/include/wlr/types/wlr_screencopy_v1.h @@ -9,6 +9,7 @@ #ifndef WLR_TYPES_WLR_SCREENCOPY_V1_H #define WLR_TYPES_WLR_SCREENCOPY_V1_H +#include <stdbool.h> #include <wayland-server.h> #include <wlr/types/wlr_box.h> @@ -35,6 +36,8 @@ struct wlr_screencopy_frame_v1 { struct wlr_box box; int stride; + bool overlay_cursor, cursor_locked; + struct wl_shm_buffer *buffer; struct wl_listener buffer_destroy; |