e_policy_wl: added aux hint for resize aspect 08/275208/1
authorJunseok Kim <juns.kim@samsung.com>
Fri, 29 Apr 2022 07:39:51 +0000 (16:39 +0900)
committerJunseok Kim <juns.kim@samsung.com>
Wed, 18 May 2022 07:17:58 +0000 (16:17 +0900)
Change-Id: Iaddd628546bf1b7f2159322a1b142d8ed4879ec1
Signed-off-by: Junseok Kim <juns.kim@samsung.com>
src/bin/e_policy_wl.c

index 1277ad8e3795fb38eff10297aee1855f4f01caac..1541c9a207d726ead1df43fff0e625e6e5ae3a4e 100644 (file)
@@ -274,6 +274,7 @@ enum _E_Policy_Hint_Type
    E_POLICY_HINT_ICONIFY_BUFFER_FLUSH = 11,
    E_POLICY_HINT_TRANSIENT_FOR_ALWAYS_ON_TOP = 12,
    E_POLICY_HINT_BELONG_TO_PARENT = 13,
+   E_POLICY_HINT_RESIZE_ASPECT_RATIO = 14,
 };
 
 static const char *hint_names[] =
@@ -292,6 +293,7 @@ static const char *hint_names[] =
    "wm.policy.win.iconify.buffer.flush",
    "wm.policy.win.transient_for.always_on_top",
    "wm.policy.win.belong_to_parent",
+   "wm.policy.win.resize_aspect_ratio",
 };
 
 static void                _e_policy_wl_surf_del(E_Policy_Wl_Surface *psurf);
@@ -2515,6 +2517,21 @@ _e_policy_wl_aux_hint_apply(E_Client *ec)
                   e_client_belong_to_parent_set(ec, EINA_FALSE);
                }
           }
+        else if (!strncmp(hint->hint, hint_names[E_POLICY_HINT_RESIZE_ASPECT_RATIO], strlen(hint->hint)))
+          {
+             if (!strncmp(hint->val, "1", 1))
+               {
+                  ELOGF("RESIZE", "Set resize aspect ratio", ec);
+                  ec->manage_resize.enable_aspect_ratio = EINA_TRUE;
+                  ec->manage_resize.aw = ec->w;
+                  ec->manage_resize.ah = ec->h;
+               }
+             else
+               {
+                  ELOGF("RESIZE", "Unset resize aspect ratio", ec);
+                  ec->manage_resize.enable_aspect_ratio = EINA_FALSE;
+               }
+          }
      }
 }