mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-17 06:46:39 -04:00
wlr_cursor_set_surface: Use wlr_raster to generate texture from surface
Since wlr_raster supports wlr_compositor usage with and without a renderer, use it for wlr_curosr so cursors support running on a surface without a renderer.
This commit is contained in:
parent
7a108f9883
commit
a9458c5bc7
1 changed files with 8 additions and 1 deletions
|
|
@ -14,6 +14,7 @@
|
|||
#include <wlr/types/wlr_compositor.h>
|
||||
#include <wlr/types/wlr_tablet_tool.h>
|
||||
#include <wlr/types/wlr_touch.h>
|
||||
#include <wlr/types/wlr_raster.h>
|
||||
#include <wlr/types/wlr_xcursor_manager.h>
|
||||
#include <wlr/util/box.h>
|
||||
#include <wlr/util/log.h>
|
||||
|
|
@ -539,7 +540,13 @@ static void cursor_output_cursor_update(struct wlr_cursor_output_cursor *output_
|
|||
} else if (cur->state->surface != NULL) {
|
||||
struct wlr_surface *surface = cur->state->surface;
|
||||
|
||||
struct wlr_texture *texture = wlr_surface_get_texture(surface);
|
||||
struct wlr_texture *texture = NULL;
|
||||
struct wlr_raster *raster = wlr_raster_from_surface(surface);
|
||||
if (raster) {
|
||||
texture = wlr_raster_obtain_texture(raster, output_cursor->output_cursor->output->renderer);
|
||||
}
|
||||
wlr_raster_unlock(raster);
|
||||
|
||||
int32_t hotspot_x = cur->state->surface_hotspot.x;
|
||||
int32_t hotspot_y = cur->state->surface_hotspot.y;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue