discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=2fabed32555d411b8c293556fb56abb90d4ae000

commit 2fabed32555d411b8c293556fb56abb90d4ae000
Author: Mike Blumenkrantz <[email protected]>
Date:   Fri May 12 12:08:32 2017 -0400

    ecore-evas: add function for unsetting a specific seat's cursor
    
    @feature
---
 src/lib/ecore_evas/Ecore_Evas.h | 17 +++++++++++++++++
 src/lib/ecore_evas/ecore_evas.c | 17 ++++++++++++-----
 2 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/src/lib/ecore_evas/Ecore_Evas.h b/src/lib/ecore_evas/Ecore_Evas.h
index 9a2d8dd..c4f7b3e 100644
--- a/src/lib/ecore_evas/Ecore_Evas.h
+++ b/src/lib/ecore_evas/Ecore_Evas.h
@@ -2424,6 +2424,23 @@ EAPI void        ecore_evas_object_cursor_set(Ecore_Evas 
*ee, Evas_Object *obj,
 EAPI Evas_Object*        ecore_evas_cursor_unset(Ecore_Evas *ee);
 
 /**
+ * @brief Unsets the cursor of the specified pointer device.
+ *
+ * @param ee The Ecore_Evas to unset the cursor.
+ * @param pointer A pointer device to set the cursor. Use @c NULL for the 
default.
+ *
+ * This function unsets the cursor from the Ecore_Evas, and returns the cursor
+ * object. If the cursor was set from ecore_evas_cursor_set(), this function
+ * returns the image. In this case, the image should be deleted when it is
+ * no longer needed.
+ *
+ * @see ecore_evas_cursor_device_set()
+ * @see ecore_evas_object_cursor_device_set()
+ * @since 1.20
+ */
+EAPI Evas_Object *ecore_evas_cursor_device_unset(Ecore_Evas *ee, 
Efl_Input_Device *pointer);
+
+/**
  * @brief Sets the cursor of an Ecore_Evas specified pointer device.
  *
  * @param ee The Ecore_Evas
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index 7c68126..16a58c2 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -1858,16 +1858,17 @@ ecore_evas_cursor_get(const Ecore_Evas *ee, Evas_Object 
**obj, int *layer, int *
 }
 
 EAPI Evas_Object *
-ecore_evas_cursor_unset(Ecore_Evas *ee)
+ecore_evas_cursor_device_unset(Ecore_Evas *ee, Efl_Input_Device *pointer)
 {
-   Ecore_Evas_Cursor *cursor;
-   Efl_Input_Device *pointer;
+   Ecore_Evas_Cursor *cursor = NULL;
    Evas_Object *obj;
 
    ECORE_EVAS_CHECK(ee, NULL);
 
-   pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_MOUSE);
-   cursor = eina_hash_find(ee->prop.cursors, &pointer);
+   if (!pointer)
+     pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_MOUSE);
+   if (pointer)
+     cursor = eina_hash_find(ee->prop.cursors, &pointer);
    EINA_SAFETY_ON_NULL_RETURN_VAL(cursor, NULL);
    obj = cursor->object;
    if (ee->engine.func->fn_object_cursor_unset)
@@ -1880,6 +1881,12 @@ ecore_evas_cursor_unset(Ecore_Evas *ee)
    return obj;
 }
 
+EAPI Evas_Object *
+ecore_evas_cursor_unset(Ecore_Evas *ee)
+{
+   return ecore_evas_cursor_device_unset(ee, NULL);
+}
+
 EAPI void
 ecore_evas_layer_set(Ecore_Evas *ee, int layer)
 {

-- 


Reply via email to