From c0fa31d6f4f06c90a8225e1ea5d43703b7f71837 Mon Sep 17 00:00:00 2001 From: Youngbok Shin Date: Mon, 25 Apr 2016 19:38:03 +0900 Subject: [PATCH] Elementary toolbar: Fix flickering issue from resizing the box multiple times Summary: The toolbar's box was resized in _sizing_eval(), _resize_job(). In _sizing_eval(), the box was resized according to its minimum size. And in _resize_job(), toolbar would recalculate it and resize the box again. If _sizing_eval() was called after resizing the box properly from _resize_job(), the box was shrank before calling the next job. If the box's minimum size is needed for calculation in the job callback, it shouldn't change box's size before the job callback. @fix Test Plan: N/A Reviewers: jaehwan, eagleeye, woohyun, cedric Subscribers: jpeg Differential Revision: https://phab.enlightenment.org/D3911 --- src/lib/elementary/elm_toolbar.c | 8 ++++++-- src/lib/elementary/elm_widget_toolbar.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/elm_toolbar.c b/src/lib/elementary/elm_toolbar.c index 6c1662fffc..039a7e4b37 100644 --- a/src/lib/elementary/elm_toolbar.c +++ b/src/lib/elementary/elm_toolbar.c @@ -370,7 +370,8 @@ _resize_job(void *data) elm_interface_scrollable_content_viewport_geometry_get (obj, NULL, NULL, &vw, &vh); evas_object_size_hint_min_get(sd->bx, &mw, &mh); - evas_object_geometry_get(sd->bx, NULL, NULL, &w, &h); + w = sd->minw_bx; + h = sd->minh_bx; if (sd->shrink_mode == ELM_TOOLBAR_SHRINK_MENU) { @@ -1536,7 +1537,10 @@ _sizing_eval(Evas_Object *obj) minh_bx = vh; } - evas_object_resize(sd->bx, minw_bx, minh_bx); + /* Keep the box's minimum size for a moment. + It will be used for resizing the box in _resize_job() function. */ + sd->minw_bx = minw_bx; + sd->minh_bx = minh_bx; evas_object_resize(sd->more, minw_bx, minh_bx); evas_object_size_hint_min_set(obj, minw, minh); evas_object_size_hint_max_set(obj, -1, -1); diff --git a/src/lib/elementary/elm_widget_toolbar.h b/src/lib/elementary/elm_widget_toolbar.h index 51be6168ad..bdb199bf49 100644 --- a/src/lib/elementary/elm_widget_toolbar.h +++ b/src/lib/elementary/elm_widget_toolbar.h @@ -43,6 +43,7 @@ struct _Elm_Toolbar_Data int theme_icon_size, priv_icon_size, icon_size; int standard_priority; + int minw_bx, minh_bx; unsigned int item_count; unsigned int separator_count; double align;