From: Hermet Park Date: Tue, 16 Mar 2021 11:11:54 +0000 (+0900) Subject: elementary slider: gurantee scroll hold push/pop match. X-Git-Tag: accepted/tizen/unified/20210319.141010~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=248fff12c982cef0b0e8030a3c8d1959da5c82a1;p=platform%2Fupstream%2Fefl.git elementary slider: gurantee scroll hold push/pop match. Mouse In/Out is not guranteed for paired event calls, Users could prevent that exception case by flaging its condition. Otherwise slider screen could be blocked in scrolling. Thus, this patch is better for safety. Change-Id: I753fbb3638b854d05945bdc8a1d372ca029d7f5a --- diff --git a/src/lib/elementary/elm_slider.c b/src/lib/elementary/elm_slider.c index 4ced3ab..829e0e1 100644 --- a/src/lib/elementary/elm_slider.c +++ b/src/lib/elementary/elm_slider.c @@ -1156,7 +1156,13 @@ _mouse_in_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) { - efl_ui_widget_scroll_hold_push(obj); + ELM_SLIDER_DATA_GET(data, sd); + + if (!sd->scroll_hold) + { + efl_ui_widget_scroll_hold_push(obj); + sd->scroll_hold = EINA_TRUE; + } } static void @@ -1165,7 +1171,13 @@ _mouse_out_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) { - efl_ui_widget_scroll_hold_pop(obj); + ELM_SLIDER_DATA_GET(data, sd); + + if (sd->scroll_hold) + { + efl_ui_widget_scroll_hold_pop(obj); + sd->scroll_hold = EINA_FALSE; + } } EOLIAN static void diff --git a/src/lib/elementary/elm_widget_slider.h b/src/lib/elementary/elm_widget_slider.h index 203b5f5..8d32a67 100644 --- a/src/lib/elementary/elm_widget_slider.h +++ b/src/lib/elementary/elm_widget_slider.h @@ -62,6 +62,7 @@ struct _Elm_Slider_Data Eina_Bool intvl_enable : 1; Eina_Bool spacer_down : 1; Eina_Bool frozen : 1; + Eina_Bool scroll_hold : 1; }; /**