rotation: add code to swap the width and height while rotating window 69/278869/1
authorDoyoun Kang <doyoun.kang@samsung.com>
Wed, 27 Jul 2022 06:49:34 +0000 (15:49 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Wed, 27 Jul 2022 06:49:34 +0000 (15:49 +0900)
When a partial window is rotated, e swaps the size of window's height and width.

Change-Id: Ibee971ae63dc236dd0f9258613a272c98886b79a

src/rotation/e_mod_rotation_wl.c

index b5fb13e..d106660 100644 (file)
@@ -957,6 +957,28 @@ _rot_eval_fetch_available_send_angle_change(Policy_Ext_Rotation *rot)
    return EINA_FALSE;
 }
 
+static Eina_Bool
+_e_client_rotation_swap_check(E_Client *ec)
+{
+   // Check whether the width and height of ec are swapped or not.
+   // If you want to make your swap policy, then you can modify this function.
+
+   int x, y, w, h;
+
+   if (e_policy_client_is_keyboard(ec) ||
+       e_policy_client_is_keyboard_sub(ec))
+     return EINA_FALSE;
+
+   e_client_geometry_get(ec, &x, &y, &w, &h);
+   if ((x != ec->zone->x) ||
+       (y != ec->zone->y) ||
+       (w != ec->zone->w) ||
+       (h != ec->zone->h))
+     return EINA_TRUE;
+
+   return EINA_FALSE;
+}
+
 static void
 _e_tizen_rotation_send_angle_change(E_Client *ec, int angle)
 {
@@ -1006,7 +1028,10 @@ _e_tizen_rotation_send_angle_change(E_Client *ec, int angle)
      {
         ver = wl_resource_get_version(resource); // resource is type of tizen_rotation_interface
 
-        if ((ver >= 2) && (ec->floating))
+        Eina_Bool need_swap = EINA_FALSE;
+        need_swap = _e_client_rotation_swap_check(ec);
+
+        if ((ver >= 2) && (need_swap))
           {
              if (rot_diff == 180)
                {