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