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)
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
568static Eina_Bool 568static Eina_Bool
569_ecore_evas_buffer_pointer_warp(const Ecore_Evas *ee, Evas_Coord x, Evas_Coord y) 569_ecore_evas_buffer_pointer_warp(const Ecore_Evas *ee, Evas_Coord x, Evas_Coord y)
570{ 570{
571 _ecore_evas_mouse_move_process((Ecore_Evas*)ee, x, y, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff)); 571 Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
572
573 if (bdata->image)
574 _ecore_evas_mouse_move_process((Ecore_Evas*)ee, x, y, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff));
575 else
576 {
577 Ecore_Event_Mouse_Move *ev;
578
579 ev = calloc(1, sizeof(Ecore_Event_Mouse_Move));
580 EINA_SAFETY_ON_NULL_RETURN_VAL(ev, EINA_FALSE);
581
582 ev->window = ee->prop.window;
583 ev->event_window = ee->prop.window;
584 ev->root_window = ee->prop.window;
585 ev->timestamp = (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff);
586 ev->same_screen = 1;
587
588 ev->x = x;
589 ev->y = y;
590 ev->root.x = x;
591 ev->root.y = y;
592
593 {
594 const char *mods[] =
595 { "Shift", "Control", "Alt", "Super", NULL };
596 int modifiers[] =
597 { ECORE_EVENT_MODIFIER_SHIFT, ECORE_EVENT_MODIFIER_CTRL, ECORE_EVENT_MODIFIER_ALT,
598 ECORE_EVENT_MODIFIER_WIN, 0 };
599 int i;
600
601 for (i = 0; mods[i]; i++)
602 if (evas_key_modifier_is_set(evas_key_modifier_get(ee->evas), mods[i]))
603 ev->modifiers |= modifiers[i];
604 }
605
606 //FIXME ev->multi.device = ???
607
608 ev->multi.radius = 1;
609 ev->multi.radius_x = 1;
610 ev->multi.radius_y = 1;
611 ev->multi.pressure = 1.0;
612 ev->multi.angle = 0.0;
613 ev->multi.x = ev->x;
614 ev->multi.y = ev->y;
615 ev->multi.root.x = ev->x;
616 ev->multi.root.y = ev->y;
617
618 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL);
619 }
572 return EINA_TRUE; 620 return EINA_TRUE;
573} 621}
574 622