scroller: Fix freeze after dragging bars
authorJean-Philippe Andre <jp.andre@samsung.com>
Wed, 12 Apr 2017 06:02:42 +0000 (15:02 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Wed, 12 Apr 2017 06:18:24 +0000 (15:18 +0900)
The freeze property is a set() only but could internally
be reset to false, after dragging a vertical or horizontal slider.

Test scenario:
  elementary_test -to scroller

Click Freeze, test the mouse wheel (can't do anything), drag a
scroller side bar, test the mouse wheel again.

Before this patch, the scroller would scroll. After the patch, the
scroller remains fixed, respecting the value of freeze.

FIXME: It is possible that the proper fix would be to disable
       bars drag during freeze, but that is not the case currently.

NOTE: freeze, hold, movement_block, lock_x/y have very similar
      meanings. The doc really needs clarification here, and some
      property might be removed. Also, freeze and hold have no
      getter, only a setter. drag_lock_x/y is part of elm_widget,
      and not specific to scrollers.

src/lib/elementary/elm_interface_scrollable.c
src/lib/elementary/elm_interface_scrollable.h

index 2335107..9c05d2f 100644 (file)
@@ -1088,7 +1088,7 @@ _elm_scroll_edje_drag_v_stop_cb(void *data,
 
    _elm_scroll_scroll_bar_read_and_update(sid);
    _elm_scroll_drag_stop(sid);
-   sid->freeze = EINA_FALSE;
+   sid->freeze = sid->freeze_want;
 }
 
 static void
@@ -1163,7 +1163,7 @@ _elm_scroll_edje_drag_h_stop_cb(void *data,
 
    _elm_scroll_scroll_bar_read_and_update(sid);
    _elm_scroll_drag_stop(sid);
-   sid->freeze = EINA_FALSE;
+   sid->freeze = sid->freeze_want;
 }
 
 static void
@@ -4259,6 +4259,7 @@ EOLIAN static void
 _elm_interface_scrollable_freeze_set(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, Eina_Bool freeze)
 {
    sid->freeze = freeze;
+   sid->freeze_want = freeze;
    if (sid->freeze)
      {
         if (sid->down.onhold_animator)
index 624c921..25245ec 100644 (file)
@@ -227,6 +227,7 @@ struct _Elm_Scrollable_Smart_Interface_Data
    Eina_Bool  bouncemey : 1;
    Eina_Bool  bouncemex : 1;
    Eina_Bool  freeze : 1;
+   Eina_Bool  freeze_want : 1;
    Eina_Bool  hold : 1;
    Eina_Bool  min_w : 1;
    Eina_Bool  min_h : 1;