summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-03-23 13:11:44 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-03-24 13:24:24 -0400
commitacf4c35fd62116bf1f6e34e9d3949a09ede7f6ad (patch)
tree9bb028227567eb0210f8b86850156d755a14cdd0
parente0170c2b0dbadb98d8e3c9f831b88764f1f8aa26 (diff)
downloadefl-acf4c35fd62116bf1f6e34e9d3949a09ede7f6ad.tar.gz
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
-rw-r--r--src/lib/ecore_evas/ecore_evas_buffer.c50
1 files changed, 49 insertions, 1 deletions
diff --git a/src/lib/ecore_evas/ecore_evas_buffer.c b/src/lib/ecore_evas/ecore_evas_buffer.c
index a7e52db2b2..80f4ac8e01 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;
}