mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 12:55:58 +01:00
backend/wayland: implement get_cursor_formats
This commit is contained in:
parent
91ee33e956
commit
de51df2770
1 changed files with 13 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue