cursor: Save the original MetaCursor a cursor came from

So we can recreate it as a server-side cursor
This commit is contained in:
Jasper St. Pierre 2014-04-23 11:04:08 -04:00
parent 1762436775
commit 98a1573bee
3 changed files with 10 additions and 0 deletions

View File

@ -36,6 +36,7 @@ typedef struct {
struct _MetaCursorReference {
int ref_count;
MetaCursor cursor;
MetaCursorImage image;
};

View File

@ -235,6 +235,7 @@ meta_cursor_reference_from_theme (MetaCursor cursor)
self = g_slice_new0 (MetaCursorReference);
self->ref_count = 1;
self->cursor = cursor;
meta_cursor_image_load_from_xcursor_image (&self->image, image);
XcursorImageDestroy (image);
@ -363,3 +364,9 @@ meta_cursor_reference_get_gbm_bo (MetaCursorReference *cursor,
*hot_y = cursor->image.hot_y;
return cursor->image.bo;
}
MetaCursor
meta_cursor_reference_get_meta_cursor (MetaCursorReference *cursor)
{
return cursor->cursor;
}

View File

@ -36,6 +36,8 @@ MetaCursorReference * meta_cursor_reference_from_buffer (struct wl_resource *buf
int hot_x,
int hot_y);
MetaCursor meta_cursor_reference_get_meta_cursor (MetaCursorReference *cursor);
Cursor meta_cursor_create_x_cursor (Display *xdisplay,
MetaCursor cursor);