[mutter] cursor: Remove cursor tracker from API
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] cursor: Remove cursor tracker from API
- Date: Wed, 23 Apr 2014 16:15:30 +0000 (UTC)
commit b501ca5a24ed9546516c53464b1d87387a40a8b1
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Wed Apr 23 10:38:30 2014 -0400
cursor: Remove cursor tracker from API
src/backends/meta-cursor.c | 17 ++++++-----------
src/backends/meta-cursor.h | 7 ++-----
src/core/display.c | 4 ++--
src/core/screen.c | 2 +-
src/wayland/meta-wayland-pointer.c | 3 +--
5 files changed, 12 insertions(+), 21 deletions(-)
---
diff --git a/src/backends/meta-cursor.c b/src/backends/meta-cursor.c
index 8357eec..8e6dbb4 100644
--- a/src/backends/meta-cursor.c
+++ b/src/backends/meta-cursor.c
@@ -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)
{
diff --git a/src/backends/meta-cursor.h b/src/backends/meta-cursor.h
index 50ad086..c478d1d 100644
--- a/src/backends/meta-cursor.h
+++ b/src/backends/meta-cursor.h
@@ -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);
diff --git a/src/core/display.c b/src/core/display.c
index ba5dbf3..e3d71fb 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -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;
diff --git a/src/core/screen.c b/src/core/screen.c
index 0dcc0c6..7fa2c77 100644
--- a/src/core/screen.c
+++ b/src/core/screen.c
@@ -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);
diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c
index 60d0155..9c4fc18 100644
--- a/src/wayland/meta-wayland-pointer.c
+++ b/src/wayland/meta-wayland-pointer.c
@@ -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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]