e_comp_object: remove the client_inset 81/318981/1
authorSooChan Lim <sc1.lim@samsung.com>
Fri, 31 Jan 2025 05:46:20 +0000 (14:46 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Mon, 3 Feb 2025 02:06:13 +0000 (11:06 +0900)
The client_inset is useless.

Change-Id: I3b78d0b17150c0a8fefddc501b961e7907da6b41

src/bin/compmgr/e_comp_object.c
src/bin/compmgr/e_comp_object_intern.h
src/include/e_comp_object.h

index 7dcfcfb7dc4c4a271ca0b2ec22f3295d19ec2c03..6dbbbf246ea41e92acc9db871837cc5ffa1e2009 100644 (file)
@@ -1096,11 +1096,6 @@ _e_comp_object_pixels_get(void *data, Evas_Object *obj EINA_UNUSED)
         bxx = pw - (bx + bxx), byy = ph - (by + byy);
         evas_object_image_border_set(cw->obj, bx, bxx, by, byy);
      }
-   else if (cw->client_inset.calc) //CSD
-     {
-        bx = -cw->client_inset.l + 4, by = -cw->client_inset.t + 4;
-        bxx = -cw->client_inset.r, byy = -cw->client_inset.b;
-     }
    else
      {
         bx = by = bxx = byy = 0;
@@ -1169,7 +1164,6 @@ static void
 _e_comp_intercept_move(void *data, Evas_Object *obj, int x, int y)
 {
    E_Comp_Object *cw = data;
-   int ix, iy, fx, fy;
 
    if (cw->render_update_lock.lock)
      {
@@ -1206,8 +1200,8 @@ _e_comp_intercept_move(void *data, Evas_Object *obj, int x, int y)
        (cw->ec->manage_resize.resize_obj))
      {
         e_client_pos_set(cw->ec, x, y);
-        cw->ec->client.x = x + cw->client_inset.l;
-        cw->ec->client.y = y + cw->client_inset.t;
+        cw->ec->client.x = x;
+        cw->ec->client.y = y;
         e_policy_visibility_client_defer_move(cw->ec);
         return;
      }
@@ -1216,16 +1210,14 @@ _e_comp_intercept_move(void *data, Evas_Object *obj, int x, int y)
     * this means that ec->client matches cw->x/y, the opposite
     * of SSD.
     */
-   fx = cw->client_inset.l;
-   fy = cw->client_inset.t;
-   if ((cw->x == x + fx) && (cw->y == y + fy))
+   if ((cw->x == x) && (cw->y == y))
      {
         if ((cw->ec->x != x) || (cw->ec->y != y))
           {
              /* handle case where client tries to move to position and back very quickly */
              e_client_pos_set(cw->ec, x, y);
-             cw->ec->client.x = x + cw->client_inset.l;
-             cw->ec->client.y = y + cw->client_inset.t;
+             cw->ec->client.x = x;
+             cw->ec->client.y = y;
           }
         return;
      }
@@ -1237,8 +1229,6 @@ _e_comp_intercept_move(void *data, Evas_Object *obj, int x, int y)
         if ((cw->ec->maximized & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_HORIZONTAL)
           x = cw->x;
      }
-   ix = x + cw->client_inset.l;
-   iy = y + cw->client_inset.t;
    if (cw->ec->maximized && (!cw->ec->maximize_override) && ((cw->ec->x != x) || (cw->ec->y != y)) &&
        ((cw->ec->maximized & E_MAXIMIZE_DIRECTION) != E_MAXIMIZE_VERTICAL) &&
        ((cw->ec->maximized & E_MAXIMIZE_DIRECTION) != E_MAXIMIZE_HORIZONTAL))
@@ -1252,8 +1242,8 @@ _e_comp_intercept_move(void *data, Evas_Object *obj, int x, int y)
         if (!zone) return;
 
         cw->ec->changes.need_unmaximize = 1;
-        cw->ec->saved.x = ix - zone->x;
-        cw->ec->saved.y = iy - zone->y;
+        cw->ec->saved.x = 0 - zone->x;
+        cw->ec->saved.y = 0 - zone->y;
         cw->ec->saved.w = cw->ec->client.w;
         cw->ec->saved.h = cw->ec->client.h;
         EC_CHANGED(cw->ec);
@@ -1280,10 +1270,10 @@ _e_comp_intercept_move(void *data, Evas_Object *obj, int x, int y)
      {
         /* only update xy position of client to avoid invalid
          * first damage region if it is not a new_client. */
-        cw->ec->client.x = ix;
-        cw->ec->client.y = iy;
+        cw->ec->client.x = 0;
+        cw->ec->client.y = 0;
 
-        x = ix, y = iy;
+        x = 0, y = 0;
         evas_object_move(obj, x, y);
      }
 }
@@ -1292,7 +1282,7 @@ static void
 _e_comp_intercept_resize(void *data, Evas_Object *obj, int w, int h)
 {
    E_Comp_Object *cw = data;
-   int pw = 0, ph = 0, fw, fh, iw, ih, prev_w, prev_h, x, y;
+   int pw = 0, ph = 0, prev_w, prev_h, x, y;
    E_Zone *zone;
 
    if (cw->render_update_lock.lock)
@@ -1307,22 +1297,21 @@ _e_comp_intercept_resize(void *data, Evas_Object *obj, int w, int h)
     * this means that ec->client matches cw->w/h, the opposite
     * of SSD.
     */
-   fw = -cw->client_inset.l - cw->client_inset.r;
-   fh = -cw->client_inset.t - cw->client_inset.b;
-   if ((cw->w == w + fw) && (cw->h == h + fh))
+   if ((cw->w == w) && (cw->h == h))
      {
         if (((cw->ec->w != w) || (cw->ec->h != h)) ||
-            (cw->ec->client.w != w - cw->client_inset.l - cw->client_inset.r) ||
-            (cw->ec->client.h != h - cw->client_inset.t - cw->client_inset.b))
+            (cw->ec->client.w != w) ||
+            (cw->ec->client.h != h))
           {
              /* handle case where client tries to resize itself and back very quickly */
              e_client_size_set(cw->ec, w, h);
-             cw->ec->client.w = w - cw->client_inset.l - cw->client_inset.r;
-             cw->ec->client.h = h - cw->client_inset.t - cw->client_inset.b;
+             cw->ec->client.w = w;
+             cw->ec->client.h = h;
              wl_signal_emit(&cw->events.resize, NULL);
           }
         return;
      }
+
    /* guarantee that fullscreen is fullscreen */
    zone = e_comp_zone_find_by_ec(cw->ec);
    if (!zone) return;
@@ -1332,8 +1321,6 @@ _e_comp_intercept_resize(void *data, Evas_Object *obj, int w, int h)
           return;
      }
    /* calculate client size */
-   iw = w - cw->client_inset.l - cw->client_inset.r;
-   ih = h - cw->client_inset.t - cw->client_inset.b;
    if (cw->ec->maximized && (!cw->ec->maximize_override) && ((cw->ec->w != w) || (cw->ec->h != h)))
      {
         /* prevent resizing while maximized depending on direction and config */
@@ -1342,18 +1329,18 @@ _e_comp_intercept_resize(void *data, Evas_Object *obj, int w, int h)
         Eina_Bool reject = EINA_FALSE;
         if (cw->ec->maximized & E_MAXIMIZE_VERTICAL)
           {
-             if (cw->ec->client.h != ih)
+             if (cw->ec->client.h != 0)
                {
-                  cw->ec->saved.h = ih;
+                  cw->ec->saved.h = 0;
                   cw->ec->saved.y = cw->ec->client.y - zone->y;
                   reject = cw->ec->changes.need_unmaximize = 1;
                }
           }
         if (cw->ec->maximized & E_MAXIMIZE_HORIZONTAL)
           {
-             if (cw->ec->client.w != iw)
+             if (cw->ec->client.w != 0)
                {
-                  cw->ec->saved.w = iw;
+                  cw->ec->saved.w = 0;
                   cw->ec->saved.x = cw->ec->client.x - zone->x;
                   reject = cw->ec->changes.need_unmaximize = 1;
                }
@@ -1387,8 +1374,8 @@ _e_comp_intercept_resize(void *data, Evas_Object *obj, int w, int h)
 
    e_client_size_set(cw->ec, w, h);
 
-   cw->ec->client.w = iw;
-   cw->ec->client.h = ih;
+   cw->ec->client.w = 0;
+   cw->ec->client.h = 0;
    if ((cw->ec->client.w < 0) || (cw->ec->client.h < 0)) CRI("WTF. ec:%p", cw->ec);
 
    /* The size of non-compositing window can be changed, so there is a
@@ -1411,10 +1398,10 @@ _e_comp_intercept_resize(void *data, Evas_Object *obj, int w, int h)
        cw->content_type == E_COMP_OBJECT_CONTENT_TYPE_EXT_EDJE)
      pw = w, ph = h;
    prev_w = cw->w, prev_h = cw->h;
-   e_comp_object_frame_wh_adjust(obj, 0, 0, &fw, &fh);
+
    /* check shading and clamp to pixmap size for regular clients */
    if ((!cw->ec->input_only) && (!cw->ec->override) &&
-       (((w - fw != pw) || (h - fh != ph))))
+       (((w != pw) || (h != ph))))
      {
         //INF("CALLBACK: REQ(%dx%d) != CUR(%dx%d)", w - fw, h - fh, pw, ph);
         wl_signal_emit(&cw->events.resize, NULL);
@@ -2093,12 +2080,7 @@ e_comp_object_frame_recalc(Evas_Object *obj)
 {
    API_ENTRY;
 
-   cw->client_inset.l = 0;
-   cw->client_inset.r = 0;
-   cw->client_inset.t = 0;
-   cw->client_inset.b = 0;
-
-   cw->client_inset.calc = 0;
+   //TODO: remove this function
 }
 
 static void
@@ -2784,56 +2766,40 @@ E_API void
 e_comp_object_frame_xy_adjust(Evas_Object *obj, int x, int y, int *ax, int *ay)
 {
    API_ENTRY;
-   if (!cw->client_inset.calc)
-     {
-        if (ax) *ax = x;
-        if (ay) *ay = y;
-        return;
-     }
-   if (ax) *ax = x - cw->client_inset.l;
-   if (ay) *ay = y - cw->client_inset.t;
+
+   // TODO: this function will be removed
+   if (ax) *ax = x;
+   if (ay) *ay = y;
 }
 
 E_API void
 e_comp_object_frame_xy_unadjust(Evas_Object *obj, int x, int y, int *ax, int *ay)
 {
    API_ENTRY;
-   if (!cw->client_inset.calc)
-     {
-        if (ax) *ax = x;
-        if (ay) *ay = y;
-        return;
-     }
-   if (ax) *ax = x + cw->client_inset.l;
-   if (ay) *ay = y + cw->client_inset.t;
+
+   // TODO: this function will be removed
+   if (ax) *ax = x;
+   if (ay) *ay = y;
 }
 
 E_API void
 e_comp_object_frame_wh_adjust(Evas_Object *obj, int w, int h, int *aw, int *ah)
 {
    API_ENTRY;
-   if (!cw->client_inset.calc)
-     {
-        if (aw) *aw = w;
-        if (ah) *ah = h;
-        return;
-     }
-   if (aw) *aw = w + cw->client_inset.l + cw->client_inset.r;
-   if (ah) *ah = h + cw->client_inset.t + cw->client_inset.b;
+
+   // TODO: this function will be removed
+   if (aw) *aw = w;
+   if (ah) *ah = h;
 }
 
 E_API void
 e_comp_object_frame_wh_unadjust(Evas_Object *obj, int w, int h, int *aw, int *ah)
 {
    API_ENTRY;
-   if (!cw->client_inset.calc)
-     {
-        if (aw) *aw = w;
-        if (ah) *ah = h;
-        return;
-     }
-   if (aw) *aw = w - cw->client_inset.l - cw->client_inset.r;
-   if (ah) *ah = h - cw->client_inset.t - cw->client_inset.b;
+
+   // TODO: this function will be removed
+   if (aw) *aw = w;
+   if (ah) *ah = h;
 }
 
 E_API E_Client *
@@ -3065,7 +3031,10 @@ EINTERN Eina_Bool
 e_comp_object_frame_allowed(Evas_Object *obj)
 {
    API_ENTRY EINA_FALSE;
-   return (!cw->client_inset.calc);
+
+   // TODO: this function will be removed
+
+   return EINA_TRUE;
 }
 
 EINTERN Eina_Bool
index b3f8abeb4a153677b592cb5291f38eeff53cdd9a..a5e46785347e1aae822cc1963c8fb0cf58a1c0dc 100644 (file)
@@ -16,7 +16,6 @@ struct _E_Comp_Object
 
    E_Client *ec;
 
-   E_Comp_Object_Frame client_inset;
    struct
    {
       double          start;
index 9e7e697fc8227172f60659dc8053998e6792a706..c03dfe61f17897139fab1c089b0de6c15c9d8959 100644 (file)
@@ -38,12 +38,6 @@ struct E_Event_Comp_Object
    Evas_Object *comp_object;
 };
 
-struct E_Comp_Object_Frame
-{
-   int l, r, t, b;
-   Eina_Bool calc : 1; // inset has been calculated
-};
-
 typedef enum _E_Comp_Object_Hook_Point
 {
    E_COMP_OBJECT_HOOK_EFFECT_START,