jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=da7281f2aedea465ea903bd5ba6e583689f59cba

commit da7281f2aedea465ea903bd5ba6e583689f59cba
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Thu Dec 1 16:35:58 2016 +0900

    win: Update min & max size hints simultaneously
    
    Avoid calling the engine's size_min_set/size_max_set functions
    while setting the hints on the window object itself (it would
    cause min != max even though we intended min == max).
---
 src/lib/elementary/efl_ui_win.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index dd36cc4..4542e5f 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -825,19 +825,28 @@ _elm_win_obj_intercept_layer_set(void *data, Evas_Object 
*obj EINA_UNUSED, int l
 /* Event Callbacks */
 
 static void
-_elm_win_obj_callback_changed_size_hints(void *data, Evas *e EINA_UNUSED, 
Evas_Object *obj, void *event_info EINA_UNUSED)
+_elm_win_size_hints_update(Efl_Ui_Win *win, Efl_Ui_Win_Data *sd)
 {
-   ELM_WIN_DATA_GET(data, sd);
    Evas_Coord minw, minh, maxw, maxh;
 
-   efl_gfx_size_hint_combined_min_get(obj, &minw, &minh);
-   efl_gfx_size_hint_max_get(obj, &maxw, &maxh);
+   efl_gfx_size_hint_combined_min_get(win, &minw, &minh);
+   efl_gfx_size_hint_max_get(win, &maxw, &maxh);
    if (maxw < 1) maxw = -1;
    if (maxh < 1) maxh = -1;
 
    TRAP(sd, size_min_set, minw, minh);
    TRAP(sd, size_max_set, maxw, maxh);
 }
+
+static void
+_elm_win_obj_callback_changed_size_hints(void *data EINA_UNUSED, Evas *e 
EINA_UNUSED,
+                                         Evas_Object *obj, void *event_info 
EINA_UNUSED)
+{
+   ELM_WIN_DATA_GET(obj, sd);
+
+   if (sd->tmp_updating_hints) return;
+   _elm_win_size_hints_update(obj, sd);
+}
 /* end of elm-win specific associate */
 
 static void
@@ -3334,6 +3343,7 @@ _elm_win_resize_objects_eval(Evas_Object *obj)
    efl_gfx_size_hint_restricted_min_set(obj, minw, minh);
    efl_gfx_size_hint_max_set(obj, maxw, maxh);
    sd->tmp_updating_hints = 0;
+   _elm_win_size_hints_update(obj, sd);
 
    evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
    w = ow;
@@ -4871,7 +4881,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, 
const char *name, Elm_W
    if (type != ELM_WIN_FAKE)
      {
         evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
-           _elm_win_obj_callback_changed_size_hints, obj);
+           _elm_win_obj_callback_changed_size_hints, NULL);
         evas_object_intercept_raise_callback_add
           (obj, _elm_win_obj_intercept_raise, obj);
         evas_object_intercept_lower_callback_add

-- 


Reply via email to