summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-05-29 09:18:31 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-05-29 12:29:03 -0400
commit1051a1ca46891206fa68ede6160aefe87c666183 (patch)
treec46167fc687fa492c46627d95b6218e2d6e32e1d
parentf0a136f9991c164998b9b26c6849585ea7647aa0 (diff)
elm/slider: avoid emitting double events when range slider value changes
Summary: in range mode, there are two slider endpoints, but only one event should be emitted if a change is detected during update @fix Depends on D8967 Reviewers: devilhorns Reviewed By: devilhorns Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8968
-rw-r--r--src/lib/elementary/elm_slider.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/elementary/elm_slider.c b/src/lib/elementary/elm_slider.c
index da37a2279b..66e5ce8491 100644
--- a/src/lib/elementary/elm_slider.c
+++ b/src/lib/elementary/elm_slider.c
@@ -538,6 +538,7 @@ _elm_slider_val_fetch(Evas_Object *obj, Elm_Slider_Data *pd, Eina_Bool user_even
538 double posx = 0.0, posy = 0.0, pos = 0.0, val; 538 double posx = 0.0, posy = 0.0, pos = 0.0, val;
539 double posx2 = 0.0, posy2 = 0.0, pos2 = 0.0, val2; 539 double posx2 = 0.0, posy2 = 0.0, pos2 = 0.0, val2;
540 Eina_Bool inverted = EINA_FALSE; 540 Eina_Bool inverted = EINA_FALSE;
541 Eina_Bool evented = EINA_FALSE;
541 542
542 EFL_UI_SLIDER_DATA_GET(obj, sd); 543 EFL_UI_SLIDER_DATA_GET(obj, sd);
543 EFL_UI_SLIDER_INTERVAL_DATA_GET(obj, id); 544 EFL_UI_SLIDER_INTERVAL_DATA_GET(obj, id);
@@ -601,13 +602,15 @@ _elm_slider_val_fetch(Evas_Object *obj, Elm_Slider_Data *pd, Eina_Bool user_even
601 efl_event_callback_legacy_call(obj, EFL_UI_SLIDER_EVENT_CHANGED, NULL); 602 efl_event_callback_legacy_call(obj, EFL_UI_SLIDER_EVENT_CHANGED, NULL);
602 ecore_timer_del(pd->delay); 603 ecore_timer_del(pd->delay);
603 pd->delay = ecore_timer_add(SLIDER_DELAY_CHANGED_INTERVAL, _delay_change, obj); 604 pd->delay = ecore_timer_add(SLIDER_DELAY_CHANGED_INTERVAL, _delay_change, obj);
605 evented = EINA_TRUE;
604 } 606 }
605 } 607 }
606 608
607 if (fabs(val2 - id->intvl_to) > DBL_EPSILON) 609 if (fabs(val2 - id->intvl_to) > DBL_EPSILON)
608 { 610 {
609 id->intvl_to = val2; 611 id->intvl_to = val2;
610 if (user_event) 612 /* avoid emitting two events and setting a timer twice */
613 if (user_event && (!evented))
611 { 614 {
612 efl_event_callback_legacy_call(obj, EFL_UI_SLIDER_EVENT_CHANGED, NULL); 615 efl_event_callback_legacy_call(obj, EFL_UI_SLIDER_EVENT_CHANGED, NULL);
613 ecore_timer_del(pd->delay); 616 ecore_timer_del(pd->delay);