summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2018-08-02 18:16:46 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2018-08-02 18:16:47 +0900
commit0b27fd8dfddd5c305d6d186dda8cef0dc6b8c172 (patch)
tree0fbeed98dfe06497873669297f76270e5912dda3
parentdbc2c880a8bb2c4457ec018ed7184362f5ff6e2e (diff)
evas_events: Fix to set mouse_in state to all pointers in the seat.
Summary: mouse coordinate is set by seat. Therefore, mouse_in state should be set based on seat. As a result, mouse_in state of all pointers in the seat should be updated at the same time. Reviewers: eagleeye, devilhorns, zmike Reviewed By: eagleeye, devilhorns, zmike Subscribers: devilhorns, Hermet, kimcinoo, cedric, iscaro, zmike, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D6699
-rw-r--r--src/lib/evas/canvas/evas_events.c45
1 files changed, 31 insertions, 14 deletions
diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c
index 3a27cf5b65..b670c60e02 100644
--- a/src/lib/evas/canvas/evas_events.c
+++ b/src/lib/evas/canvas/evas_events.c
@@ -555,6 +555,23 @@ _evas_event_source_mouse_down_events(Evas_Object *eo_obj, Evas *eo_e,
555} 555}
556 556
557static void 557static void
558_evas_event_mouse_in_set(Evas_Pointer_Seat *pseat,
559 Evas_Object_Protected_Data *obj, Eina_Bool mouse_in)
560{
561 Evas_Pointer_Data *pdata;
562 Evas_Object_Pointer_Data *obj_pdata;
563
564 if ((!pseat) || (!obj)) return;
565
566 EINA_INLIST_FOREACH(pseat->pointers, pdata)
567 {
568 obj_pdata = _evas_object_pointer_data_get(pdata, obj);
569 if (obj_pdata)
570 obj_pdata->mouse_in = mouse_in;
571 }
572}
573
574static void
558_evas_event_source_mouse_move_events(Evas_Object *eo_obj, Evas *eo_e, 575_evas_event_source_mouse_move_events(Evas_Object *eo_obj, Evas *eo_e,
559 Efl_Input_Pointer *parent_ev, 576 Efl_Input_Pointer *parent_ev,
560 Evas_Pointer_Data *pdata, 577 Evas_Pointer_Data *pdata,
@@ -639,7 +656,7 @@ _evas_event_source_mouse_move_events(Evas_Object *eo_obj, Evas *eo_e,
639 if ((obj_pdata->mouse_grabbed == 0) && (!e->delete_me)) 656 if ((obj_pdata->mouse_grabbed == 0) && (!e->delete_me))
640 { 657 {
641 if (obj_pdata->mouse_in) continue; /* FIXME: dubious logic! */ 658 if (obj_pdata->mouse_in) continue; /* FIXME: dubious logic! */
642 obj_pdata->mouse_in = 0; 659 _evas_event_mouse_in_set(pdata->seat, child, 0);
643 if (e->is_frozen) continue; 660 if (e->is_frozen) continue;
644 ev->cur = curpt_real; 661 ev->cur = curpt_real;
645 _evas_event_havemap_adjust_f(eo_child, child, &ev->cur, obj_pdata->mouse_grabbed); 662 _evas_event_havemap_adjust_f(eo_child, child, &ev->cur, obj_pdata->mouse_grabbed);
@@ -702,7 +719,7 @@ _evas_event_source_mouse_move_events(Evas_Object *eo_obj, Evas *eo_e,
702 } 719 }
703 else if (obj_pdata->mouse_in) 720 else if (obj_pdata->mouse_in)
704 { 721 {
705 obj_pdata->mouse_in = 0; 722 _evas_event_mouse_in_set(pdata->seat, child, 0);
706 if (e->is_frozen) continue; 723 if (e->is_frozen) continue;
707 ev->cur = curpt; 724 ev->cur = curpt;
708 _evas_event_havemap_adjust_f(eo_child, child, &ev->cur, obj_pdata->mouse_grabbed); 725 _evas_event_havemap_adjust_f(eo_child, child, &ev->cur, obj_pdata->mouse_grabbed);
@@ -731,7 +748,7 @@ _evas_event_source_mouse_move_events(Evas_Object *eo_obj, Evas *eo_e,
731 { 748 {
732 if (!obj_pdata->mouse_in) 749 if (!obj_pdata->mouse_in)
733 { 750 {
734 obj_pdata->mouse_in = 1; 751 _evas_event_mouse_in_set(pdata->seat, child, 1);
735 if (e->is_frozen) continue; 752 if (e->is_frozen) continue;
736 ev->cur = curpt; 753 ev->cur = curpt;
737 _evas_event_havemap_adjust_f(eo_child, child, &ev->cur, obj_pdata->mouse_grabbed); 754 _evas_event_havemap_adjust_f(eo_child, child, &ev->cur, obj_pdata->mouse_grabbed);
@@ -1222,7 +1239,7 @@ _evas_event_source_mouse_in_events(Evas_Object *eo_obj, Evas *eo_e,
1222 if (!eina_list_data_find(src->proxy->src_event_in, eo_child)) 1239 if (!eina_list_data_find(src->proxy->src_event_in, eo_child))
1223 { 1240 {
1224 if (obj_pdata->mouse_in) continue; 1241 if (obj_pdata->mouse_in) continue;
1225 obj_pdata->mouse_in = 1; 1242 _evas_event_mouse_in_set(pdata->seat, child, 1);
1226 ev->cur = point; 1243 ev->cur = point;
1227 _evas_event_havemap_adjust_f(eo_child, child, &ev->cur, obj_pdata->mouse_grabbed); 1244 _evas_event_havemap_adjust_f(eo_child, child, &ev->cur, obj_pdata->mouse_grabbed);
1228 ev->action = EFL_POINTER_ACTION_IN; 1245 ev->action = EFL_POINTER_ACTION_IN;
@@ -1292,7 +1309,7 @@ _evas_event_source_mouse_out_events(Evas_Object *eo_obj, Evas *eo_e,
1292 } 1309 }
1293 1310
1294 if (!obj_pdata->mouse_in) continue; 1311 if (!obj_pdata->mouse_in) continue;
1295 obj_pdata->mouse_in = 0; 1312 _evas_event_mouse_in_set(pdata->seat, child, 0);
1296 if (child->delete_me) continue; 1313 if (child->delete_me) continue;
1297 1314
1298 ev->cur = point; 1315 ev->cur = point;
@@ -1620,7 +1637,7 @@ _post_up_handle(Evas_Public_Data *e, Efl_Input_Pointer *parent_ev,
1620 continue; 1637 continue;
1621 } 1638 }
1622 if (!obj_pdata->mouse_in) continue; 1639 if (!obj_pdata->mouse_in) continue;
1623 obj_pdata->mouse_in = 0; 1640 _evas_event_mouse_in_set(pdata->seat, obj, 0);
1624 if (!e->is_frozen) 1641 if (!e->is_frozen)
1625 { 1642 {
1626 ev->cur.x = pdata->seat->x; 1643 ev->cur.x = pdata->seat->x;
@@ -1658,7 +1675,7 @@ _post_up_handle(Evas_Public_Data *e, Efl_Input_Pointer *parent_ev,
1658 continue; 1675 continue;
1659 } 1676 }
1660 if (obj_pdata->mouse_in) continue; 1677 if (obj_pdata->mouse_in) continue;
1661 obj_pdata->mouse_in = 1; 1678 _evas_event_mouse_in_set(pdata->seat, obj_itr, 1);
1662 if (e->is_frozen) continue; 1679 if (e->is_frozen) continue;
1663 ev->cur.x = pdata->seat->x; 1680 ev->cur.x = pdata->seat->x;
1664 ev->cur.y = pdata->seat->y; 1681 ev->cur.y = pdata->seat->y;
@@ -2199,7 +2216,7 @@ _canvas_event_feed_mouse_move_internal(Evas_Public_Data *e, Efl_Input_Pointer_Da
2199 if ((obj_pdata->mouse_grabbed == 0) && (!e->delete_me)) 2216 if ((obj_pdata->mouse_grabbed == 0) && (!e->delete_me))
2200 { 2217 {
2201 if (!obj_pdata->mouse_in) continue; 2218 if (!obj_pdata->mouse_in) continue;
2202 obj_pdata->mouse_in = 0; 2219 _evas_event_mouse_in_set(pdata->seat, obj, 0);
2203 if (obj->delete_me || e->is_frozen) continue; 2220 if (obj->delete_me || e->is_frozen) continue;
2204 pdata->seat->object.in = eina_list_remove(pdata->seat->object.in, eo_obj); 2221 pdata->seat->object.in = eina_list_remove(pdata->seat->object.in, eo_obj);
2205 ev->cur = point; 2222 ev->cur = point;
@@ -2259,7 +2276,7 @@ _canvas_event_feed_mouse_move_internal(Evas_Public_Data *e, Efl_Input_Pointer_Da
2259 /* otherwise it has left the object */ 2276 /* otherwise it has left the object */
2260 else if (obj_pdata->mouse_in) 2277 else if (obj_pdata->mouse_in)
2261 { 2278 {
2262 obj_pdata->mouse_in = 0; 2279 _evas_event_mouse_in_set(pdata->seat, obj, 0);
2263 if (e->is_frozen) continue; 2280 if (e->is_frozen) continue;
2264 ev->cur = point; 2281 ev->cur = point;
2265 _evas_event_havemap_adjust_f(eo_obj, obj, &ev->cur, obj_pdata->mouse_grabbed); 2282 _evas_event_havemap_adjust_f(eo_obj, obj, &ev->cur, obj_pdata->mouse_grabbed);
@@ -2293,7 +2310,7 @@ _canvas_event_feed_mouse_move_internal(Evas_Public_Data *e, Efl_Input_Pointer_Da
2293 } 2310 }
2294 if (!obj_pdata->mouse_in) 2311 if (!obj_pdata->mouse_in)
2295 { 2312 {
2296 obj_pdata->mouse_in = 1; 2313 _evas_event_mouse_in_set(pdata->seat, obj, 1);
2297 if (e->is_frozen) continue; 2314 if (e->is_frozen) continue;
2298 ev->cur = point; 2315 ev->cur = point;
2299 _evas_event_havemap_adjust_f(eo_obj, obj, &ev->cur, obj_pdata->mouse_grabbed); 2316 _evas_event_havemap_adjust_f(eo_obj, obj, &ev->cur, obj_pdata->mouse_grabbed);
@@ -2404,7 +2421,7 @@ nogrep:
2404 { 2421 {
2405 /* otherwise it has left the object */ 2422 /* otherwise it has left the object */
2406 if (!obj_pdata->mouse_in) continue; 2423 if (!obj_pdata->mouse_in) continue;
2407 obj_pdata->mouse_in = 0; 2424 _evas_event_mouse_in_set(pdata->seat, obj, 0);
2408 if (e->is_frozen) continue; 2425 if (e->is_frozen) continue;
2409 ev->cur = point; 2426 ev->cur = point;
2410 _evas_event_havemap_adjust_f(eo_obj, obj, &ev->cur, obj_pdata->mouse_grabbed); 2427 _evas_event_havemap_adjust_f(eo_obj, obj, &ev->cur, obj_pdata->mouse_grabbed);
@@ -2436,7 +2453,7 @@ nogrep:
2436 continue; 2453 continue;
2437 } 2454 }
2438 if (obj_pdata->mouse_in) continue; 2455 if (obj_pdata->mouse_in) continue;
2439 obj_pdata->mouse_in = 1; 2456 _evas_event_mouse_in_set(pdata->seat, obj, 1);
2440 if (e->is_frozen) continue; 2457 if (e->is_frozen) continue;
2441 ev->cur = point; 2458 ev->cur = point;
2442 _evas_event_havemap_adjust_f(eo_obj, obj, &ev->cur, obj_pdata->mouse_grabbed); 2459 _evas_event_havemap_adjust_f(eo_obj, obj, &ev->cur, obj_pdata->mouse_grabbed);
@@ -2575,7 +2592,7 @@ _canvas_event_feed_mouse_in_internal(Evas *eo_e, Efl_Input_Pointer_Data *ev)
2575 continue; 2592 continue;
2576 } 2593 }
2577 if (obj_pdata->mouse_in) continue; 2594 if (obj_pdata->mouse_in) continue;
2578 obj_pdata->mouse_in = 1; 2595 _evas_event_mouse_in_set(pdata->seat, obj, 1);
2579 ev->cur.x = pdata->seat->x; 2596 ev->cur.x = pdata->seat->x;
2580 ev->cur.y = pdata->seat->y; 2597 ev->cur.y = pdata->seat->y;
2581 _evas_event_havemap_adjust_f(eo_obj, obj, &ev->cur, obj_pdata->mouse_grabbed); 2598 _evas_event_havemap_adjust_f(eo_obj, obj, &ev->cur, obj_pdata->mouse_grabbed);
@@ -2672,7 +2689,7 @@ _canvas_event_feed_mouse_out_internal(Evas *eo_e, Efl_Input_Pointer_Data *ev)
2672 continue; 2689 continue;
2673 } 2690 }
2674 if (!obj_pdata->mouse_in) continue; 2691 if (!obj_pdata->mouse_in) continue;
2675 obj_pdata->mouse_in = 0; 2692 _evas_event_mouse_in_set(pdata->seat, obj, 0);
2676 ev->cur.x = pdata->seat->x; 2693 ev->cur.x = pdata->seat->x;
2677 ev->cur.y = pdata->seat->y; 2694 ev->cur.y = pdata->seat->y;
2678 _evas_event_havemap_adjust_f(eo_obj, obj, &ev->cur, obj_pdata->mouse_grabbed); 2695 _evas_event_havemap_adjust_f(eo_obj, obj, &ev->cur, obj_pdata->mouse_grabbed);