jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=4eb13031eef17f3359fa27eed3dd3c27ca439f95

commit 4eb13031eef17f3359fa27eed3dd3c27ca439f95
Author: Jean-Philippe Andre <[email protected]>
Date:   Thu Jun 15 09:56:59 2017 +0900

    evas: Disable calls to evas_device_class_set
    
    After finalize, the type of an input device can not be changed.
    So, deprecate the function and prevent anything from happening
    unless we're inside efl_add().
    
    Ref T5515
---
 src/lib/evas/Evas_Common.h        | 4 +++-
 src/lib/evas/canvas/evas_device.c | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/lib/evas/Evas_Common.h b/src/lib/evas/Evas_Common.h
index 789e3f3242..80e36587e5 100644
--- a/src/lib/evas/Evas_Common.h
+++ b/src/lib/evas/Evas_Common.h
@@ -1153,9 +1153,11 @@ EAPI const Evas_Device *evas_device_parent_get(const 
Evas_Device *dev);
  * This sets the "primary" class of device (a broad thing like mouse, keyboard,
  * touch, pen etc.).
  *
+ * @deprecated The class of a device can not be changed after creation.
+ *
  * @since 1.8
  */
-EAPI void evas_device_class_set(Evas_Device *dev, Evas_Device_Class clas);
+EAPI void evas_device_class_set(Evas_Device *dev, Evas_Device_Class clas) 
EINA_DEPRECATED;
 
 /**
  * Get the major class of a device
diff --git a/src/lib/evas/canvas/evas_device.c 
b/src/lib/evas/canvas/evas_device.c
index 783497ad98..87f4f47a03 100644
--- a/src/lib/evas/canvas/evas_device.c
+++ b/src/lib/evas/canvas/evas_device.c
@@ -350,6 +350,7 @@ EAPI void
 evas_device_class_set(Evas_Device *dev, Evas_Device_Class clas)
 {
    SAFETY_CHECK(dev, EFL_INPUT_DEVICE_CLASS);
+   EINA_SAFETY_ON_TRUE_RETURN(efl_finalized_get(dev));
 
    Efl_Input_Device_Data *d = efl_data_scope_get(dev, EFL_INPUT_DEVICE_CLASS);
    Evas_Public_Data *edata = efl_data_scope_get(d->evas, EVAS_CANVAS_CLASS);

-- 


Reply via email to