From 98a1573beec33f34186fff3bd52ce8d84916d6f9 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Wed, 23 Apr 2014 11:04:08 -0400 Subject: [PATCH] cursor: Save the original MetaCursor a cursor came from So we can recreate it as a server-side cursor --- src/backends/meta-cursor-private.h | 1 + src/backends/meta-cursor.c | 7 +++++++ src/backends/meta-cursor.h | 2 ++ 3 files changed, 10 insertions(+) diff --git a/src/backends/meta-cursor-private.h b/src/backends/meta-cursor-private.h index b1490212a..09ab9928d 100644 --- a/src/backends/meta-cursor-private.h +++ b/src/backends/meta-cursor-private.h @@ -36,6 +36,7 @@ typedef struct { struct _MetaCursorReference { int ref_count; + MetaCursor cursor; MetaCursorImage image; }; diff --git a/src/backends/meta-cursor.c b/src/backends/meta-cursor.c index 1558ed5d8..828a1fffe 100644 --- a/src/backends/meta-cursor.c +++ b/src/backends/meta-cursor.c @@ -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; +} diff --git a/src/backends/meta-cursor.h b/src/backends/meta-cursor.h index 483115eb4..e9e12907e 100644 --- a/src/backends/meta-cursor.h +++ b/src/backends/meta-cursor.h @@ -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);