e_mod_rotation_wl: code cleanup - check ec's size and type 96/239496/1
authorDoyoun Kang <doyoun.kang@samsung.com>
Mon, 27 Jul 2020 06:52:11 +0000 (15:52 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Mon, 27 Jul 2020 06:52:11 +0000 (15:52 +0900)
Change-Id: I77a1f56cbfff053da7d5b17dab711db7033c48e8

src/rotation/e_mod_rotation_wl.c

index 314442f..b0694de 100644 (file)
@@ -1023,6 +1023,22 @@ _e_client_rotation_angle_is_allowed(E_Client *ec, int angle)
    return EINA_TRUE;
 }
 
+static Eina_Bool
+_e_client_rotation_check_ec_size_and_type(E_Zone *zone, E_Client *ec)
+{
+   if (!zone) return EINA_FALSE;
+   if (!ec) return EINA_FALSE;
+
+   if ((ec->x == zone->x) && (ec->y == zone->y) &&
+       (ec->w == zone->w) && (ec->h == zone->h) &&
+       (ec->e.state.rot.type == E_CLIENT_ROTATION_TYPE_NORMAL))
+     {
+        return EINA_TRUE;
+     }
+
+   return EINA_FALSE;
+}
+
 /* TODO need to optimize */
 static Eina_Bool
 _e_client_rotation_zone_set(E_Zone *zone, E_Client *include_ec, E_Client *exclude_ec)
@@ -1082,9 +1098,7 @@ _e_client_rotation_zone_set(E_Zone *zone, E_Client *include_ec, E_Client *exclud
                   continue;
                }
 
-             if ((ec->x == zone->x) && (ec->y == zone->y) &&
-                 (ec->w == zone->w) && (ec->h == zone->h) &&
-                 (ec->e.state.rot.type == E_CLIENT_ROTATION_TYPE_NORMAL))
+             if (_e_client_rotation_check_ec_size_and_type(zone, ec))
                {
                   if (!ec->argb)
                     {
@@ -1153,9 +1167,7 @@ _e_client_rotation_zone_set(E_Zone *zone, E_Client *include_ec, E_Client *exclud
               * visibility's deiconify rendering logic.
               */
              else if ((fg_ec != ec) &&
-                 (ec->x == zone->x) && (ec->y == zone->y) &&
-                 (ec->w == zone->w) && (ec->h == zone->h) &&
-                 (ec->e.state.rot.type == E_CLIENT_ROTATION_TYPE_NORMAL))
+                      _e_client_rotation_check_ec_size_and_type(zone, ec))
                {
                   if (!ec->argb)
                     continue;