evas: Set locks and modifiers for all input events
authorJean-Philippe Andre <jp.andre@samsung.com>
Wed, 7 Jun 2017 05:53:08 +0000 (14:53 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Wed, 7 Jun 2017 06:25:01 +0000 (15:25 +0900)
See also eb27724eb9c32a954c2f75b45307a207d0 which didn't fix
the reported issue. Not quite sure yet how to implement those
lock & modifiers for fake events (i.e. artificially created
by the app itself).

Fixes T5510

src/lib/evas/canvas/efl_input_key.c
src/lib/evas/canvas/efl_input_pointer.c

index f9d2f15..d4154ce 100644 (file)
@@ -41,6 +41,7 @@ _efl_input_key_efl_input_event_instance_get(Eo *klass EINA_UNUSED, void *_pd EIN
 {
    Efl_Input_Key_Data *ev;
    Efl_Input_Key *evt;
+   Evas *evas;
 
    if (s_cached_event)
      {
@@ -58,6 +59,14 @@ _efl_input_key_efl_input_event_instance_get(Eo *klass EINA_UNUSED, void *_pd EIN
    ev->fake = EINA_FALSE;
    if (priv) *priv = ev;
 
+   evas = efl_provider_find(owner, EVAS_CANVAS_CLASS);
+   if (evas)
+     {
+        Evas_Public_Data *e = efl_data_scope_get(evas, EVAS_CANVAS_CLASS);
+        ev->modifiers = &e->modifiers;
+        ev->locks = &e->locks;
+     }
+
    return evt;
 }
 
index 6354ecd..01a20c1 100644 (file)
@@ -48,10 +48,11 @@ _del_hook(Eo *evt)
 
 EOLIAN static Efl_Input_Pointer *
 _efl_input_pointer_efl_input_event_instance_get(Eo *klass EINA_UNUSED, void *_pd EINA_UNUSED,
-                                          Eo *owner, void **priv)
+                                                Eo *owner, void **priv)
 {
    Efl_Input_Pointer_Data *ev;
    Efl_Input_Pointer *evt;
+   Evas *evas;
 
    if (s_cached_event)
      {
@@ -69,6 +70,14 @@ _efl_input_pointer_efl_input_event_instance_get(Eo *klass EINA_UNUSED, void *_pd
    ev->fake = EINA_FALSE;
    if (priv) *priv = ev;
 
+   evas = efl_provider_find(owner, EVAS_CANVAS_CLASS);
+   if (evas)
+     {
+        Evas_Public_Data *e = efl_data_scope_get(evas, EVAS_CANVAS_CLASS);
+        ev->modifiers = &e->modifiers;
+        ev->locks = &e->locks;
+     }
+
    return evt;
 }