ecore_x: add function to show and hide X cursor.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
thierry E 2017-05-09 10:13:11 -07:00 committed by Cedric BAIL
parent 71c8f1de27
commit 07024ab6c8
2 changed files with 31 additions and 0 deletions

View File

@ -2436,6 +2436,8 @@ EAPI void ecore_x_region_expand(Ecore_X_Region dest, Ecore_X_Regio
EAPI void ecore_x_region_gc_clip_set(Ecore_X_Region region, Ecore_X_GC gc, int x_origin, int y_origin);
EAPI void ecore_x_region_window_shape_set(Ecore_X_Region region, Ecore_X_Window win, Ecore_X_Shape_Type type, int x_offset, int y_offset);
EAPI void ecore_x_region_picture_clip_set(Ecore_X_Region region, Ecore_X_Picture picture, int x_origin, int y_origin);
EAPI void ecore_x_cursor_show(void);
EAPI void ecore_x_cursor_hide(void);
/**
* xfixes selection notification request.

View File

@ -10,6 +10,7 @@
static int _fixes_available;
#ifdef ECORE_XFIXES
static int _fixes_major, _fixes_minor;
static int _cursor_visible = 1;
#endif /* ifdef ECORE_XFIXES */
void
@ -406,3 +407,31 @@ ecore_x_region_picture_clip_set(Ecore_X_Region region,
if (_ecore_xlib_sync) ecore_x_sync();
#endif /* ifdef ECORE_XFIXES */
}
EAPI void
ecore_x_cursor_show(void)
{
EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
#ifdef ECORE_XFIXES
if (!_cursor_visible)
{
XFixesShowCursor(_ecore_x_disp, DefaultRootWindow(_ecore_x_disp));
XFlush(_ecore_x_disp);
_cursor_visible = 1;
}
#endif /* ifdef ECORE_XFIXES */
}
EAPI void
ecore_x_cursor_hide(void)
{
EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
#ifdef ECORE_XFIXES
if (_cursor_visible)
{
XFixesHideCursor(_ecore_x_disp, DefaultRootWindow(_ecore_x_disp));
XFlush(_ecore_x_disp);
_cursor_visible = 0;
}
#endif /* ifdef ECORE_XFIXES */
}