mirror of
https://github.com/brl/mutter.git
synced 2025-06-15 17:59:31 +00:00
seat: Move cursor storage to MetaWaylandPointer
This commit is contained in:
@ -49,6 +49,8 @@
|
||||
|
||||
#include "meta-wayland-pointer.h"
|
||||
#include "meta-wayland-private.h"
|
||||
#include "meta-cursor.h"
|
||||
#include "meta-cursor-tracker-private.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@ -599,3 +601,28 @@ meta_wayland_pointer_update_current_focus (MetaWaylandPointer *pointer,
|
||||
interface->focus (pointer->grab, surface);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
meta_wayland_pointer_update_cursor_surface (MetaWaylandPointer *pointer)
|
||||
{
|
||||
MetaCursorReference *cursor;
|
||||
|
||||
if (pointer->cursor_tracker == NULL)
|
||||
return;
|
||||
|
||||
if (pointer->cursor_surface && pointer->cursor_surface->buffer)
|
||||
{
|
||||
struct wl_resource *buffer = pointer->cursor_surface->buffer->resource;
|
||||
cursor = meta_cursor_reference_from_buffer (pointer->cursor_tracker,
|
||||
buffer,
|
||||
pointer->hotspot_x,
|
||||
pointer->hotspot_y);
|
||||
}
|
||||
else
|
||||
cursor = NULL;
|
||||
|
||||
meta_cursor_tracker_set_window_cursor (pointer->cursor_tracker, cursor);
|
||||
|
||||
if (cursor)
|
||||
meta_cursor_reference_unref (cursor);
|
||||
}
|
||||
|
Reference in New Issue
Block a user