diff options
Diffstat (limited to 'backend')
-rw-r--r-- | backend/wayland/output.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/backend/wayland/output.c b/backend/wayland/output.c index ae2f942e..cdf78b2a 100644 --- a/backend/wayland/output.c +++ b/backend/wayland/output.c @@ -20,6 +20,7 @@ #include "render/pixel_format.h" #include "render/swapchain.h" #include "render/wlr_renderer.h" +#include "types/wlr_buffer.h" #include "util/signal.h" #include "linux-dmabuf-unstable-v1-client-protocol.h" @@ -510,6 +511,17 @@ static bool output_set_cursor(struct wlr_output *wlr_output, return true; } +static const struct wlr_drm_format_set *output_get_cursor_formats( + struct wlr_output *wlr_output, uint32_t buffer_caps) { + struct wlr_wl_output *output = get_wl_output_from_output(wlr_output); + if (buffer_caps & WLR_BUFFER_CAP_DMABUF) { + return &output->backend->linux_dmabuf_v1_formats; + } else if (buffer_caps & WLR_BUFFER_CAP_SHM) { + return &output->backend->shm_formats; + } + return NULL; +} + static void output_destroy(struct wlr_output *wlr_output) { struct wlr_wl_output *output = get_wl_output_from_output(wlr_output); if (output == NULL) { @@ -569,6 +581,7 @@ static const struct wlr_output_impl output_impl = { .rollback_render = output_rollback_render, .set_cursor = output_set_cursor, .move_cursor = output_move_cursor, + .get_cursor_formats = output_get_cursor_formats, }; bool wlr_output_is_wl(struct wlr_output *wlr_output) { |