summaryrefslogtreecommitdiff
path: root/src/lib/ecore_x
diff options
context:
space:
mode:
authorthierry E <thierry@substantiel.fr>2017-05-09 10:13:11 -0700
committerCedric BAIL <cedric@osg.samsung.com>2017-05-09 10:15:02 -0700
commit07024ab6c84ddadd74a7c5c08a2661af51e38997 (patch)
tree16fd8141af82f2f6498da2f58b0862c0b9d3fb2e /src/lib/ecore_x
parent71c8f1de27c17cd7cf249af16915295fe6fd7fc6 (diff)
ecore_x: add function to show and hide X cursor.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/ecore_x')
-rw-r--r--src/lib/ecore_x/Ecore_X.h2
-rw-r--r--src/lib/ecore_x/ecore_x_fixes.c29
2 files changed, 31 insertions, 0 deletions
diff --git a/src/lib/ecore_x/Ecore_X.h b/src/lib/ecore_x/Ecore_X.h
index c81be31..8c0c7d3 100644
--- a/src/lib/ecore_x/Ecore_X.h
+++ b/src/lib/ecore_x/Ecore_X.h
@@ -2436,6 +2436,8 @@ EAPI void ecore_x_region_expand(Ecore_X_Region dest, Ecore_X_Regio
2436EAPI void ecore_x_region_gc_clip_set(Ecore_X_Region region, Ecore_X_GC gc, int x_origin, int y_origin); 2436EAPI void ecore_x_region_gc_clip_set(Ecore_X_Region region, Ecore_X_GC gc, int x_origin, int y_origin);
2437EAPI 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); 2437EAPI 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);
2438EAPI void ecore_x_region_picture_clip_set(Ecore_X_Region region, Ecore_X_Picture picture, int x_origin, int y_origin); 2438EAPI void ecore_x_region_picture_clip_set(Ecore_X_Region region, Ecore_X_Picture picture, int x_origin, int y_origin);
2439EAPI void ecore_x_cursor_show(void);
2440EAPI void ecore_x_cursor_hide(void);
2439 2441
2440/** 2442/**
2441 * xfixes selection notification request. 2443 * xfixes selection notification request.
diff --git a/src/lib/ecore_x/ecore_x_fixes.c b/src/lib/ecore_x/ecore_x_fixes.c
index 3043235..f656ede 100644
--- a/src/lib/ecore_x/ecore_x_fixes.c
+++ b/src/lib/ecore_x/ecore_x_fixes.c
@@ -10,6 +10,7 @@
10static int _fixes_available; 10static int _fixes_available;
11#ifdef ECORE_XFIXES 11#ifdef ECORE_XFIXES
12static int _fixes_major, _fixes_minor; 12static int _fixes_major, _fixes_minor;
13static int _cursor_visible = 1;
13#endif /* ifdef ECORE_XFIXES */ 14#endif /* ifdef ECORE_XFIXES */
14 15
15void 16void
@@ -406,3 +407,31 @@ ecore_x_region_picture_clip_set(Ecore_X_Region region,
406 if (_ecore_xlib_sync) ecore_x_sync(); 407 if (_ecore_xlib_sync) ecore_x_sync();
407#endif /* ifdef ECORE_XFIXES */ 408#endif /* ifdef ECORE_XFIXES */
408} 409}
410
411EAPI void
412ecore_x_cursor_show(void)
413{
414 EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
415#ifdef ECORE_XFIXES
416 if (!_cursor_visible)
417 {
418 XFixesShowCursor(_ecore_x_disp, DefaultRootWindow(_ecore_x_disp));
419 XFlush(_ecore_x_disp);
420 _cursor_visible = 1;
421 }
422#endif /* ifdef ECORE_XFIXES */
423}
424
425EAPI void
426ecore_x_cursor_hide(void)
427{
428 EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
429#ifdef ECORE_XFIXES
430 if (_cursor_visible)
431 {
432 XFixesHideCursor(_ecore_x_disp, DefaultRootWindow(_ecore_x_disp));
433 XFlush(_ecore_x_disp);
434 _cursor_visible = 0;
435 }
436#endif /* ifdef ECORE_XFIXES */
437}