cursor-tracker: Make set_window_cursor take a MetaCursorReference as well

This commit is contained in:
Jasper St. Pierre 2014-03-31 16:50:15 -04:00
parent fa60824096
commit be60e4f6e7
3 changed files with 20 additions and 25 deletions

View File

@ -82,13 +82,11 @@ gboolean meta_cursor_tracker_handle_xevent (MetaCursorTracker *tracker,
void meta_cursor_tracker_set_grab_cursor (MetaCursorTracker *tracker, void meta_cursor_tracker_set_grab_cursor (MetaCursorTracker *tracker,
MetaCursorReference *cursor); MetaCursorReference *cursor);
void meta_cursor_tracker_set_window_cursor (MetaCursorTracker *tracker, void meta_cursor_tracker_set_window_cursor (MetaCursorTracker *tracker,
struct wl_resource *buffer, MetaCursorReference *cursor);
int hot_x, void meta_cursor_tracker_unset_window_cursor (MetaCursorTracker *tracker);
int hot_y); void meta_cursor_tracker_set_root_cursor (MetaCursorTracker *tracker,
void meta_cursor_tracker_unset_window_cursor (MetaCursorTracker *tracker); MetaCursor cursor);
void meta_cursor_tracker_set_root_cursor (MetaCursorTracker *tracker,
MetaCursor cursor);
void meta_cursor_tracker_update_position (MetaCursorTracker *tracker, void meta_cursor_tracker_update_position (MetaCursorTracker *tracker,
int new_x, int new_x,

View File

@ -383,18 +383,9 @@ meta_cursor_tracker_set_grab_cursor (MetaCursorTracker *tracker,
} }
void void
meta_cursor_tracker_set_window_cursor (MetaCursorTracker *tracker, meta_cursor_tracker_set_window_cursor (MetaCursorTracker *tracker,
struct wl_resource *buffer, MetaCursorReference *cursor)
int hot_x,
int hot_y)
{ {
MetaCursorReference *cursor;
if (buffer)
cursor = meta_cursor_reference_from_buffer (tracker, buffer, hot_x, hot_y);
else
cursor = NULL;
set_window_cursor (tracker, TRUE, cursor); set_window_cursor (tracker, TRUE, cursor);
} }

View File

@ -68,20 +68,26 @@ set_cursor_surface (MetaWaylandSeat *seat,
void void
meta_wayland_seat_update_cursor_surface (MetaWaylandSeat *seat) meta_wayland_seat_update_cursor_surface (MetaWaylandSeat *seat)
{ {
struct wl_resource *buffer; MetaCursorReference *cursor;
if (seat->cursor_tracker == NULL) if (seat->cursor_tracker == NULL)
return; return;
if (seat->cursor_surface && seat->cursor_surface->buffer) if (seat->cursor_surface && seat->cursor_surface->buffer)
buffer = seat->cursor_surface->buffer->resource; {
struct wl_resource *buffer = seat->cursor_surface->buffer->resource;
cursor = meta_cursor_reference_from_buffer (seat->cursor_tracker,
buffer,
seat->hotspot_x,
seat->hotspot_y);
}
else else
buffer = NULL; cursor = NULL;
meta_cursor_tracker_set_window_cursor (seat->cursor_tracker, meta_cursor_tracker_set_window_cursor (seat->cursor_tracker, cursor);
buffer,
seat->hotspot_x, if (cursor)
seat->hotspot_y); meta_cursor_reference_unref (cursor);
} }
static void static void