From 6327b8d15a7c72ad5faba5de0c038d0082104009 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Wed, 4 Sep 2013 16:56:00 +0200 Subject: [PATCH] MetaCursorTracker: add methods for setting the cursor visibility clutter_stage_show_cursor()/hide_cursor() only works in the X11 backend (where someone else is in charge of showing the cursor), and even then, it has confusing effects when running nested wayland, so an abstraction layer is needed. https://bugzilla.gnome.org/show_bug.cgi?id=707474 --- src/core/meta-cursor-tracker.c | 12 ++++++++++++ src/meta/meta-cursor-tracker.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/src/core/meta-cursor-tracker.c b/src/core/meta-cursor-tracker.c index bfe35d5a5..704295116 100644 --- a/src/core/meta-cursor-tracker.c +++ b/src/core/meta-cursor-tracker.c @@ -294,3 +294,15 @@ meta_cursor_tracker_get_pointer (MetaCursorTracker *tracker, gdk_screen_get_root_window (gscreen), NULL, (GdkModifierType*)mods); } + +void +meta_cursor_tracker_set_pointer_visible (MetaCursorTracker *tracker, + gboolean visible) +{ + if (visible) + XFixesShowCursor (tracker->screen->display->xdisplay, + tracker->screen->xroot); + else + XFixesHideCursor (tracker->screen->display->xdisplay, + tracker->screen->xroot); +} diff --git a/src/meta/meta-cursor-tracker.h b/src/meta/meta-cursor-tracker.h index 8862e4345..39202951a 100644 --- a/src/meta/meta-cursor-tracker.h +++ b/src/meta/meta-cursor-tracker.h @@ -52,5 +52,7 @@ void meta_cursor_tracker_get_pointer (MetaCursorTracker *tracker, int *x, int *y, ClutterModifierType *mods); +void meta_cursor_tracker_set_pointer_visible (MetaCursorTracker *tracker, + gboolean visible); #endif