cursor: Remove cursor tracker from API
This commit is contained in:
parent
10ac86b950
commit
b501ca5a24
@ -28,7 +28,6 @@
|
|||||||
#include "display-private.h"
|
#include "display-private.h"
|
||||||
#include "screen-private.h"
|
#include "screen-private.h"
|
||||||
#include "meta-backend.h"
|
#include "meta-backend.h"
|
||||||
#include "meta-cursor-tracker-private.h"
|
|
||||||
#include "backends/native/meta-cursor-renderer-native.h"
|
#include "backends/native/meta-cursor-renderer-native.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -135,8 +134,7 @@ meta_display_create_x_cursor (MetaDisplay *display,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static XcursorImage *
|
static XcursorImage *
|
||||||
load_cursor_on_client (MetaDisplay *display,
|
load_cursor_on_client (MetaCursor cursor)
|
||||||
MetaCursor cursor)
|
|
||||||
{
|
{
|
||||||
return XcursorLibraryLoadImage (translate_meta_cursor (cursor),
|
return XcursorLibraryLoadImage (translate_meta_cursor (cursor),
|
||||||
meta_prefs_get_cursor_theme (),
|
meta_prefs_get_cursor_theme (),
|
||||||
@ -190,8 +188,7 @@ get_gbm_device (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
meta_cursor_image_load_from_xcursor_image (MetaCursorTracker *tracker,
|
meta_cursor_image_load_from_xcursor_image (MetaCursorImage *image,
|
||||||
MetaCursorImage *image,
|
|
||||||
XcursorImage *xc_image)
|
XcursorImage *xc_image)
|
||||||
{
|
{
|
||||||
int width, height, rowstride;
|
int width, height, rowstride;
|
||||||
@ -234,19 +231,18 @@ meta_cursor_image_load_from_xcursor_image (MetaCursorTracker *tracker,
|
|||||||
}
|
}
|
||||||
|
|
||||||
MetaCursorReference *
|
MetaCursorReference *
|
||||||
meta_cursor_reference_from_theme (MetaCursorTracker *tracker,
|
meta_cursor_reference_from_theme (MetaCursor cursor)
|
||||||
MetaCursor cursor)
|
|
||||||
{
|
{
|
||||||
MetaCursorReference *self;
|
MetaCursorReference *self;
|
||||||
XcursorImage *image;
|
XcursorImage *image;
|
||||||
|
|
||||||
image = load_cursor_on_client (tracker->screen->display, cursor);
|
image = load_cursor_on_client (cursor);
|
||||||
if (!image)
|
if (!image)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
self = g_slice_new0 (MetaCursorReference);
|
self = g_slice_new0 (MetaCursorReference);
|
||||||
self->ref_count = 1;
|
self->ref_count = 1;
|
||||||
meta_cursor_image_load_from_xcursor_image (tracker, &self->image, image);
|
meta_cursor_image_load_from_xcursor_image (&self->image, image);
|
||||||
|
|
||||||
XcursorImageDestroy (image);
|
XcursorImageDestroy (image);
|
||||||
return self;
|
return self;
|
||||||
@ -338,8 +334,7 @@ meta_cursor_image_load_from_buffer (MetaCursorImage *image,
|
|||||||
}
|
}
|
||||||
|
|
||||||
MetaCursorReference *
|
MetaCursorReference *
|
||||||
meta_cursor_reference_from_buffer (MetaCursorTracker *tracker,
|
meta_cursor_reference_from_buffer (struct wl_resource *buffer,
|
||||||
struct wl_resource *buffer,
|
|
||||||
int hot_x,
|
int hot_x,
|
||||||
int hot_y)
|
int hot_y)
|
||||||
{
|
{
|
||||||
|
@ -27,15 +27,12 @@ typedef struct _MetaCursorReference MetaCursorReference;
|
|||||||
MetaCursorReference * meta_cursor_reference_ref (MetaCursorReference *cursor);
|
MetaCursorReference * meta_cursor_reference_ref (MetaCursorReference *cursor);
|
||||||
void meta_cursor_reference_unref (MetaCursorReference *cursor);
|
void meta_cursor_reference_unref (MetaCursorReference *cursor);
|
||||||
|
|
||||||
#include <meta/meta-cursor-tracker.h>
|
|
||||||
#include <meta/common.h>
|
#include <meta/common.h>
|
||||||
#include <wayland-server.h>
|
#include <wayland-server.h>
|
||||||
|
|
||||||
MetaCursorReference * meta_cursor_reference_from_theme (MetaCursorTracker *tracker,
|
MetaCursorReference * meta_cursor_reference_from_theme (MetaCursor cursor);
|
||||||
MetaCursor cursor);
|
|
||||||
|
|
||||||
MetaCursorReference * meta_cursor_reference_from_buffer (MetaCursorTracker *tracker,
|
MetaCursorReference * meta_cursor_reference_from_buffer (struct wl_resource *buffer,
|
||||||
struct wl_resource *buffer,
|
|
||||||
int hot_x,
|
int hot_x,
|
||||||
int hot_y);
|
int hot_y);
|
||||||
|
|
||||||
|
@ -1767,7 +1767,7 @@ meta_display_set_grab_op_cursor (MetaDisplay *display,
|
|||||||
|
|
||||||
meta_error_trap_pop (display);
|
meta_error_trap_pop (display);
|
||||||
|
|
||||||
cursor_ref = meta_cursor_reference_from_theme (tracker, cursor);
|
cursor_ref = meta_cursor_reference_from_theme (cursor);
|
||||||
meta_cursor_tracker_set_grab_cursor (tracker, cursor_ref);
|
meta_cursor_tracker_set_grab_cursor (tracker, cursor_ref);
|
||||||
meta_cursor_reference_unref (cursor_ref);
|
meta_cursor_reference_unref (cursor_ref);
|
||||||
}
|
}
|
||||||
|
@ -1389,7 +1389,7 @@ meta_screen_update_cursor (MetaScreen *screen)
|
|||||||
MetaCursorReference *cursor_ref;
|
MetaCursorReference *cursor_ref;
|
||||||
MetaCursorTracker *tracker = meta_cursor_tracker_get_for_screen (screen);
|
MetaCursorTracker *tracker = meta_cursor_tracker_get_for_screen (screen);
|
||||||
|
|
||||||
cursor_ref = meta_cursor_reference_from_theme (tracker, cursor);
|
cursor_ref = meta_cursor_reference_from_theme (cursor);
|
||||||
meta_cursor_tracker_set_root_cursor (tracker, cursor_ref);
|
meta_cursor_tracker_set_root_cursor (tracker, cursor_ref);
|
||||||
meta_cursor_reference_unref (cursor_ref);
|
meta_cursor_reference_unref (cursor_ref);
|
||||||
|
|
||||||
|
@ -748,8 +748,7 @@ meta_wayland_pointer_update_cursor_surface (MetaWaylandPointer *pointer)
|
|||||||
if (pointer->cursor_surface && pointer->cursor_surface->buffer)
|
if (pointer->cursor_surface && pointer->cursor_surface->buffer)
|
||||||
{
|
{
|
||||||
struct wl_resource *buffer = pointer->cursor_surface->buffer->resource;
|
struct wl_resource *buffer = pointer->cursor_surface->buffer->resource;
|
||||||
cursor = meta_cursor_reference_from_buffer (pointer->cursor_tracker,
|
cursor = meta_cursor_reference_from_buffer (buffer,
|
||||||
buffer,
|
|
||||||
pointer->hotspot_x,
|
pointer->hotspot_x,
|
||||||
pointer->hotspot_y);
|
pointer->hotspot_y);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user