efl_ui_win: support border style window. 96/286896/2
authorHosang Kim <hosang12.kim@samsung.com>
Mon, 16 Jan 2023 09:49:28 +0000 (18:49 +0900)
committerHosang Kim <hosang12.kim@samsung.com>
Mon, 16 Jan 2023 11:13:41 +0000 (20:13 +0900)
1. set minimum size of window to border size.
2. fix calcuating maximized window size.

Change-Id: Ie1dfb33515555943c982cc81899d86bee69c575f

src/lib/elementary/efl_ui_win.c

index 21b5a57..f04afa8 100644 (file)
@@ -1169,10 +1169,17 @@ _elm_win_size_hints_update(Efl_Ui_Win *win, Efl_Ui_Win_Data *sd)
    max = efl_gfx_hint_size_combined_max_get(win);
    if (max.w < 1) max.w = -1;
    if (max.h < 1) max.h = -1;
-   /*TIZEN_ONLY(20221111): Disable automatic size_min/max_set.
+   if (sd->frame_obj)
+     {
+        int fw, fh;
+
+        evas_output_framespace_get(sd->evas, NULL, NULL, &fw, &fh);
+        min.w += fw;
+        min.h += fh;
+     }
+
    TRAP(sd, size_min_set, min.w, min.h);
    TRAP(sd, size_max_set, max.w, max.h);
-   */
 }
 
 static void
@@ -1982,11 +1989,7 @@ _elm_win_frame_obj_update(Efl_Ui_Win_Data *sd, Eina_Bool force)
 
    if (!sd->first_draw) return;
 
-   evas_object_geometry_get(sd->obj, NULL, NULL, &w, &h);
-   if (w && h)
-     {
-        TRAP(sd, resize, w, h);
-     }
+   _elm_win_resize_objects_eval(sd->obj, force);
 }
 
 static int
@@ -3909,7 +3912,7 @@ _efl_ui_win_efl_gfx_entity_size_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Size2D sz
         sd->req_w = sz.w;
         sd->req_h = sz.h;
         //TIZEN_ONLY(20221228): add resize request set for ignoring configure event
-        if (sz.w > 1 && sz.h > 1)
+        if (sz.w > 1 && sz.h > 1 && !sd->frame_obj)
           {
              if ((sd->rot == 0) || (sd->rot == 180))
                {
@@ -4445,7 +4448,7 @@ _elm_win_resize_objects_eval(Evas_Object *obj, Eina_Bool force_resize)
    double wx, wy;
 
    evas_object_size_hint_combined_min_get(sd->legacy.edje, &minw, &minh);
-   if ((!minw) && (!minh) && (!sd->deferred_resize_job)) return;
+   if ((!minw) && (!minh) && (!sd->deferred_resize_job) && (!force_resize)) return;
 
    efl_gfx_hint_size_restricted_max_set(obj, EINA_SIZE2D(-1, -1));
    // If content has a weight, make resizable
@@ -4476,17 +4479,6 @@ _elm_win_resize_objects_eval(Evas_Object *obj, Eina_Bool force_resize)
         _elm_win_frame_style_update(sd, 0, 1);
      }
 
-   if (sd->frame_obj)
-     {
-        int fw, fh;
-
-        evas_output_framespace_get(sd->evas, NULL, NULL, &fw, &fh);
-        minw += fw;
-        minh += fh;
-        maxw += fw;
-        maxh += fh;
-     }
-
    sd->tmp_updating_hints = 1;
    efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(minw, minh));
    efl_gfx_hint_size_restricted_max_set(obj, EINA_SIZE2D(maxw, maxh));
@@ -4494,7 +4486,7 @@ _elm_win_resize_objects_eval(Evas_Object *obj, Eina_Bool force_resize)
    _elm_win_size_hints_update(obj, sd);
 
    /* do not need to go below. if you go, ee could become 0. */
-   if ((!minw) && (!minh)) return;
+   if ((!minw) && (!minh) && (!force_resize)) return;
 
    evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
    w = ow;