summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHosang Kim <hosang12.kim@samsung.com>2015-06-03 22:08:38 +0900
committerChunEon Park <hermet@hermet.pe.kr>2015-06-15 09:56:02 +0900
commit8ee96d16f1e311bbd08c992d45df83a415a36510 (patch)
tree395814a1cf24e92dcc4a42cf4cf050e686c81027
parent05020bb88e9091cdf04071816197b1d1ae45c72b (diff)
elm_interface_scrollable : Fix logic about setting EVAS_EVENT_FLAG_ON_HOLD
Summary: Even if scroller is not scrolled, EVAS_EVENT_FLAG_ON_HOLD is set. So clicked event is canceled in Edje. Test Plan: On the button in the vertical scroller, click button and move mouse horizontal. Mouse up on the button, so now button is not clicked Reviewers: Hermet, CHAN, seoz, jaehwan, woohyun, SanghyeonLee Differential Revision: https://phab.enlightenment.org/D2550
-rw-r--r--src/lib/elm_interface_scrollable.c66
1 files changed, 44 insertions, 22 deletions
diff --git a/src/lib/elm_interface_scrollable.c b/src/lib/elm_interface_scrollable.c
index fbfd7cead..bf598db07 100644
--- a/src/lib/elm_interface_scrollable.c
+++ b/src/lib/elm_interface_scrollable.c
@@ -2782,49 +2782,62 @@ _elm_scroll_post_event_move(void *data,
2782 elm_widget_parents_bounce_get(sid->obj, &horiz, &vert); 2782 elm_widget_parents_bounce_get(sid->obj, &horiz, &vert);
2783 if (sid->down.hold_parent) 2783 if (sid->down.hold_parent)
2784 { 2784 {
2785 if ((sid->down.dir_x) && horiz && 2785 if ((sid->down.dir_x) && (horiz || !sid->bounce_horiz) &&
2786 !_elm_scroll_can_scroll(sid, sid->down.hdir)) 2786 !_elm_scroll_can_scroll(sid, sid->down.hdir))
2787 { 2787 {
2788 sid->down.dir_x = EINA_FALSE; 2788 sid->down.dir_x = EINA_FALSE;
2789 } 2789 }
2790 if ((sid->down.dir_y) && vert && 2790 if ((sid->down.dir_y) && (vert || !sid->bounce_vert) &&
2791 !_elm_scroll_can_scroll(sid, sid->down.vdir)) 2791 !_elm_scroll_can_scroll(sid, sid->down.vdir))
2792 { 2792 {
2793 sid->down.dir_y = EINA_FALSE; 2793 sid->down.dir_y = EINA_FALSE;
2794 } 2794 }
2795 sid->down.dragged_began = EINA_TRUE;
2795 } 2796 }
2796 if (sid->down.dir_x) 2797 if (sid->down.dir_x)
2797 { 2798 {
2798 if ((!sid->obj) || 2799 if ((!sid->obj) ||
2799 (!elm_widget_drag_child_locked_x_get(sid->obj))) 2800 (!elm_widget_drag_child_locked_x_get(sid->obj)))
2800 { 2801 {
2801 sid->down.want_dragged = EINA_FALSE; 2802 if (sid->down.dragged_began)
2802 sid->down.dragged = EINA_TRUE;
2803 if (sid->obj)
2804 { 2803 {
2805 elm_widget_drag_lock_x_set(sid->obj, 1); 2804 sid->down.want_dragged = EINA_FALSE;
2805 sid->down.dragged = EINA_TRUE;
2806 if (sid->obj)
2807 {
2808 elm_widget_drag_lock_x_set(sid->obj, 1);
2809 }
2810 start = 1;
2806 } 2811 }
2807 start = 1;
2808 } 2812 }
2809 else 2813 else
2810 sid->down.dir_x = EINA_FALSE; 2814 {
2815 sid->down.dragged_began = EINA_TRUE;
2816 sid->down.dir_x = EINA_FALSE;
2817 }
2811 } 2818 }
2812 if (sid->down.dir_y) 2819 if (sid->down.dir_y)
2813 { 2820 {
2814 if ((!sid->obj) || 2821 if ((!sid->obj) ||
2815 (!elm_widget_drag_child_locked_y_get(sid->obj))) 2822 (!elm_widget_drag_child_locked_y_get(sid->obj)))
2816 { 2823 {
2817 sid->down.want_dragged = EINA_FALSE; 2824 if (sid->down.dragged_began)
2818 sid->down.dragged = EINA_TRUE;
2819 if (sid->obj)
2820 { 2825 {
2821 elm_widget_drag_lock_y_set 2826 sid->down.want_dragged = EINA_FALSE;
2822 (sid->obj, EINA_TRUE); 2827 sid->down.dragged = EINA_TRUE;
2828 if (sid->obj)
2829 {
2830 elm_widget_drag_lock_y_set
2831 (sid->obj, EINA_TRUE);
2832 }
2833 start = 1;
2823 } 2834 }
2824 start = 1;
2825 } 2835 }
2826 else 2836 else
2827 sid->down.dir_y = EINA_FALSE; 2837 {
2838 sid->down.dragged_began = EINA_TRUE;
2839 sid->down.dir_y = EINA_FALSE;
2840 }
2828 } 2841 }
2829 if ((!sid->down.dir_x) && (!sid->down.dir_y)) 2842 if ((!sid->down.dir_x) && (!sid->down.dir_y))
2830 { 2843 {
@@ -3137,10 +3150,9 @@ _elm_scroll_mouse_move_event_cb(void *data,
3137 3150
3138 if (sid->one_direction_at_a_time) 3151 if (sid->one_direction_at_a_time)
3139 { 3152 {
3140 if (!((sid->down.dir_x) || (sid->down.dir_y)) && 3153 if (((x * x) + (y * y)) >
3141 (((x * x) + (y * y)) > 3154 (_elm_config->thumbscroll_threshold *
3142 (_elm_config->thumbscroll_threshold * 3155 _elm_config->thumbscroll_threshold))
3143 _elm_config->thumbscroll_threshold)))
3144 { 3156 {
3145 if (sid->one_direction_at_a_time == 3157 if (sid->one_direction_at_a_time ==
3146 ELM_SCROLLER_SINGLE_DIRECTION_SOFT) 3158 ELM_SCROLLER_SINGLE_DIRECTION_SOFT)
@@ -3236,13 +3248,19 @@ _elm_scroll_mouse_move_event_cb(void *data,
3236 sid->down.dragged_began_timestamp = ecore_loop_time_get(); 3248 sid->down.dragged_began_timestamp = ecore_loop_time_get();
3237#endif 3249#endif
3238 } 3250 }
3239 sid->down.dragged_began = EINA_TRUE; 3251
3240 if (!sid->down.dragged) 3252 if (!sid->down.dragged)
3241 { 3253 {
3242 sid->down.want_dragged = EINA_TRUE; 3254 sid->down.want_dragged = EINA_TRUE;
3255 }
3256 if ((((_elm_scroll_can_scroll(sid, LEFT) || _elm_scroll_can_scroll(sid, RIGHT)) && sid->down.dir_x) ||
3257 ((_elm_scroll_can_scroll(sid, UP) || _elm_scroll_can_scroll(sid, DOWN)) && sid->down.dir_y)) &&
3258 !sid->down.dragged_began)
3259 {
3243 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; 3260 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
3261 sid->down.dragged_began = EINA_TRUE;
3244 } 3262 }
3245 if (sid->down.dragged) 3263 else if (sid->down.dragged_began)
3246 { 3264 {
3247 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; 3265 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
3248 } 3266 }
@@ -3309,7 +3327,11 @@ _elm_scroll_mouse_move_event_cb(void *data,
3309 { 3327 {
3310 if (sid->down.dragged_began) 3328 if (sid->down.dragged_began)
3311 { 3329 {
3312 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; 3330 if ((_elm_scroll_can_scroll(sid, sid->down.hdir) && sid->down.dir_x) ||
3331 (_elm_scroll_can_scroll(sid, sid->down.vdir) && sid->down.dir_y))
3332 {
3333 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
3334 }
3313 if (!sid->down.hold) 3335 if (!sid->down.hold)
3314 { 3336 {
3315 sid->down.hold = EINA_TRUE; 3337 sid->down.hold = EINA_TRUE;