discomfitor pushed a commit to branch master.

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

commit acf4c35fd62116bf1f6e34e9d3949a09ede7f6ad
Author: Mike Blumenkrantz <[email protected]>
Date:   Thu Mar 23 13:11:44 2017 -0400

    ecore-evas: better handling for pointer_warp with buffer canvas
    
    if buffer canvas is not image object, this needs to emit a move event
    to be consistent with other engines
    
    probably this should emit events in all cases, but adding for image buffers
    this close to release seems potentially risky so I'll leave that for later
    
    ref 4a691f79df88d4b26c5af48ffb811e28f031e2f1
---
 src/lib/ecore_evas/ecore_evas_buffer.c | 50 +++++++++++++++++++++++++++++++++-
 1 file changed, 49 insertions(+), 1 deletion(-)

diff --git a/src/lib/ecore_evas/ecore_evas_buffer.c 
b/src/lib/ecore_evas/ecore_evas_buffer.c
index a7e52db..80f4ac8 100644
--- a/src/lib/ecore_evas/ecore_evas_buffer.c
+++ b/src/lib/ecore_evas/ecore_evas_buffer.c
@@ -568,7 +568,55 @@ _ecore_evas_buffer_pointer_xy_get(const Ecore_Evas *ee, 
Evas_Coord *x, Evas_Coor
 static Eina_Bool
 _ecore_evas_buffer_pointer_warp(const Ecore_Evas *ee, Evas_Coord x, Evas_Coord 
y)
 {
-   _ecore_evas_mouse_move_process((Ecore_Evas*)ee, x, y, (unsigned 
int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff));
+   Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
+
+   if (bdata->image)
+     _ecore_evas_mouse_move_process((Ecore_Evas*)ee, x, y, (unsigned 
int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff));
+   else
+     {
+        Ecore_Event_Mouse_Move *ev;
+
+        ev = calloc(1, sizeof(Ecore_Event_Mouse_Move));
+        EINA_SAFETY_ON_NULL_RETURN_VAL(ev, EINA_FALSE);
+
+        ev->window = ee->prop.window;
+        ev->event_window = ee->prop.window;
+        ev->root_window = ee->prop.window;
+        ev->timestamp = (unsigned int)((unsigned long long)(ecore_time_get() * 
1000.0) & 0xffffffff);
+        ev->same_screen = 1;
+
+        ev->x = x;
+        ev->y = y;
+        ev->root.x = x;
+        ev->root.y = y;
+
+        {
+           const char *mods[] = 
+             { "Shift", "Control", "Alt", "Super", NULL };
+           int modifiers[] =
+             { ECORE_EVENT_MODIFIER_SHIFT, ECORE_EVENT_MODIFIER_CTRL, 
ECORE_EVENT_MODIFIER_ALT,
+               ECORE_EVENT_MODIFIER_WIN, 0 };
+           int i;
+           
+           for (i = 0; mods[i]; i++)
+             if (evas_key_modifier_is_set(evas_key_modifier_get(ee->evas), 
mods[i]))
+               ev->modifiers |= modifiers[i];
+        }
+
+        //FIXME ev->multi.device = ???
+
+        ev->multi.radius = 1;
+        ev->multi.radius_x = 1;
+        ev->multi.radius_y = 1;
+        ev->multi.pressure = 1.0;
+        ev->multi.angle = 0.0;
+        ev->multi.x = ev->x;
+        ev->multi.y = ev->y;
+        ev->multi.root.x = ev->x;
+        ev->multi.root.y = ev->y;
+
+        ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL);
+     }
    return EINA_TRUE;
 }
 

-- 


Reply via email to