e_zone: fix the bug at e_zone_add 33/295533/1
authorSooChan Lim <sc1.lim@samsung.com>
Mon, 10 Jul 2023 10:41:11 +0000 (19:41 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Mon, 10 Jul 2023 10:49:48 +0000 (19:49 +0900)
The zone_ec is always NULL because the ec has not been set
to the zone before.

Change-Id: I6b55428f16187ad434c63d20035897e8079fba87

src/bin/e_zone.c

index 4fd2d60..e33b610 100644 (file)
@@ -1295,23 +1295,12 @@ e_zone_screen_splitscreen_enable(E_Zone *zone)
 EINTERN void
 e_zone_client_add(E_Zone *zone, E_Client *ec)
 {
-   E_Zone *ec_zone;
-
-   ec_zone = e_comp_zone_find_by_ec(ec);
-
    /* if the window does not lie in the new zone, move it so that it does */
    if (!E_INTERSECTS(ec->x, ec->y, ec->w, ec->h, zone->x, zone->y, zone->w, zone->h))
      {
         int x, y;
 
-        if (ec_zone)
-          {
-             /* first guess -- get offset from old zone, and apply to new zone */
-             x = zone->x + (ec->x - ec_zone->x);
-             y = zone->y + (ec->y - ec_zone->y);
-          }
-        else
-          x = ec->x, y = ec->y;
+        x = ec->x, y = ec->y;
 
         /* keep window from hanging off bottom and left */
         if (x + ec->w > zone->x + zone->w) x += (zone->x + zone->w) - (x + ec->w);
@@ -1337,8 +1326,8 @@ e_zone_client_add(E_Zone *zone, E_Client *ec)
    //        2. This code should be removed because e_client_zone_set() is called
    //        inside e_client_desk_set(). It makes the infinite loop calls(circular calls).
    //        e_client_desk_set() -> e_client_zone_set() -> e_zone_client_add() -> e_client_desk_set() -> ... and so on.
-   if ((!ec->desk) || (ec->desk->zone != ec_zone))
-     e_client_desk_set(ec, e_desk_current_get(ec_zone));
+   if ((!ec->desk) || (ec->desk->zone != zone))
+     e_client_desk_set(ec, e_desk_current_get(zone));
 
    e_client_res_change_geometry_save(ec);
    e_client_res_change_geometry_restore(ec);