summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaeun Choi <jaeun12.choi@samsung.com>2018-01-16 13:51:11 +0900
committerJaeun Choi <jaeun12.choi@samsung.com>2018-01-16 14:42:58 +0900
commit2acfc3e381dc4fc87e3249b0f63f1ba5e0d1c2de (patch)
tree1e85258e9a653f1da74ee16707cd11191f32260f
parent65b828b050abc56a1aee4f722535de3e0bea5fbb (diff)
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.
-rw-r--r--src/lib/elementary/elm_panel.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/lib/elementary/elm_panel.c b/src/lib/elementary/elm_panel.c
index 1ccf497193..f24874a8d8 100644
--- a/src/lib/elementary/elm_panel.c
+++ b/src/lib/elementary/elm_panel.c
@@ -343,7 +343,7 @@ static void
343_drawer_close(Evas_Object *obj, Evas_Coord w, Evas_Coord h, Eina_Bool anim) 343_drawer_close(Evas_Object *obj, Evas_Coord w, Evas_Coord h, Eina_Bool anim)
344{ 344{
345 ELM_PANEL_DATA_GET(obj, sd); 345 ELM_PANEL_DATA_GET(obj, sd);
346 int x = 0, y = 0; 346 int x = 0, y = 0, cx, cy;
347 Eina_Bool horizontal = EINA_FALSE; 347 Eina_Bool horizontal = EINA_FALSE;
348 348
349 elm_widget_tree_unfocusable_set(obj, EINA_TRUE); 349 elm_widget_tree_unfocusable_set(obj, EINA_TRUE);
@@ -369,6 +369,25 @@ _drawer_close(Evas_Object *obj, Evas_Coord w, Evas_Coord h, Eina_Bool anim)
369 break; 369 break;
370 } 370 }
371 371
372 elm_interface_scrollable_content_pos_get(obj, &cx, &cy);
373
374 if ((x == cx) && (y == cy))
375 {
376 if (!sd->freeze)
377 {
378 if (horizontal)
379 elm_interface_scrollable_movement_block_set
380 (EFL_UI_SCROLL_BLOCK_HORIZONTAL);
381 else
382 elm_interface_scrollable_movement_block_set
383 (EFL_UI_SCROLL_BLOCK_VERTICAL);
384 sd->freeze = EINA_TRUE;
385 elm_layout_signal_emit(sd->scr_ly, "elm,state,content,hidden", "elm");
386 }
387
388 return;
389 }
390
372 if (anim) 391 if (anim)
373 { 392 {
374 if (sd->freeze) 393 if (sd->freeze)