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
This commit is contained in:
Giovanni Campagna 2013-09-04 16:56:00 +02:00
parent 3053cc0de4
commit 6327b8d15a
2 changed files with 14 additions and 0 deletions

View File

@ -294,3 +294,15 @@ meta_cursor_tracker_get_pointer (MetaCursorTracker *tracker,
gdk_screen_get_root_window (gscreen), gdk_screen_get_root_window (gscreen),
NULL, (GdkModifierType*)mods); 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);
}

View File

@ -52,5 +52,7 @@ void meta_cursor_tracker_get_pointer (MetaCursorTracker *tracker,
int *x, int *x,
int *y, int *y,
ClutterModifierType *mods); ClutterModifierType *mods);
void meta_cursor_tracker_set_pointer_visible (MetaCursorTracker *tracker,
gboolean visible);
#endif #endif