From: Jaeun Choi Date: Tue, 16 Jan 2018 05:45:36 +0000 (+0900) Subject: elm_panel: add exception handling in _drawer_close() X-Git-Tag: submit/tizen_4.0/20180124.101838~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=70ae00f8821c7ea007aeabb04b1beb3bf95cd65c;p=platform%2Fupstream%2Felementary.git elm_panel: add exception handling in _drawer_close() this fixes a bug with scrollable panel not being blocked when it is closed. scroll is blocked in _anim_stop_cb(), which is called after elm_interface_scrollable_region_bring_in(). but if panel content is already at the target position, _anim_stop_cb() is not called. so there is a need to check content's position and handle the exceptional case. Change-Id: I9b993dd4d5f776511b5f0b1006cfc6302cadaf76 origin: upstream (d36c849e2003aaa54432b74bcabe9f838d992a36) --- diff --git a/src/lib/elm_panel.c b/src/lib/elm_panel.c index cfd83fb6c..174ae0738 100644 --- a/src/lib/elm_panel.c +++ b/src/lib/elm_panel.c @@ -427,7 +427,7 @@ static void _drawer_close(Evas_Object *obj, Evas_Coord w, Evas_Coord h, Eina_Bool anim) { ELM_PANEL_DATA_GET(obj, sd); - int x = 0, y = 0; + int x = 0, y = 0, cx, cy; Eina_Bool horizontal = EINA_FALSE; elm_widget_tree_unfocusable_set(obj, EINA_TRUE); @@ -453,6 +453,25 @@ _drawer_close(Evas_Object *obj, Evas_Coord w, Evas_Coord h, Eina_Bool anim) break; } + eo_do(obj, elm_interface_scrollable_content_pos_get(&cx, &cy)); + + if ((x == cx) && (y == cy)) + { + if (!sd->freeze) + { + if (horizontal) + eo_do(obj, elm_interface_scrollable_movement_block_set + (ELM_SCROLLER_MOVEMENT_BLOCK_HORIZONTAL)); + else + eo_do(obj, elm_interface_scrollable_movement_block_set + (ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL)); + sd->freeze = EINA_TRUE; + elm_layout_signal_emit(sd->scr_ly, "elm,state,content,hidden", "elm"); + } + + return; + } + if (anim) { if (sd->freeze)