e_client: get base output resolution during update 67/302667/1
authorJunseok Kim <juns.kim@samsung.com>
Fri, 8 Dec 2023 09:06:30 +0000 (18:06 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Tue, 12 Dec 2023 00:21:55 +0000 (09:21 +0900)
Change-Id: I1aa45652f60358b6ad03ceceaa07a2eac6c9e7a7

src/bin/e_appinfo.c
src/bin/e_appinfo.h
src/bin/e_client.c
src/bin/e_policy.c
src/bin/e_policy.h
src/bin/e_policy_wl.c
src/bin/e_policy_wl.h

index 92354cc..a74570d 100644 (file)
@@ -201,6 +201,14 @@ e_appinfo_ready_metadata(E_Appinfo *eai, pid_t pid)
 }
 
 EINTERN Eina_Bool
+e_appinfo_base_output_resolution_available_get(E_Appinfo *eai)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(eai, EINA_FALSE);
+
+   return eai->base_output_available;
+}
+
+EINTERN Eina_Bool
 e_appinfo_base_output_resolution_get(E_Appinfo *eai, int *width, int *height)
 {
    EINA_SAFETY_ON_NULL_RETURN_VAL(eai, EINA_FALSE);
index c1bc3e9..877b8db 100644 (file)
@@ -36,6 +36,7 @@ E_API   pid_t                e_appinfo_pid_get(E_Appinfo *eai);
 EINTERN Eina_Bool            e_appinfo_pid_set(E_Appinfo *eai, pid_t pid);
 EINTERN Eina_Bool            e_appinfo_appid_set(E_Appinfo *eai, const char *appid);
 EINTERN void                 e_appinfo_ready_metadata(E_Appinfo *eai, pid_t pid);
+EINTERN Eina_Bool            e_appinfo_base_output_resolution_available_get(E_Appinfo *eai);
 EINTERN Eina_Bool            e_appinfo_base_output_resolution_get(E_Appinfo *eai, int *width, int *height);
 EINTERN E_Appinfo_Owner      e_appinfo_owner_get(E_Appinfo *eai);
 EINTERN void                 e_appinfo_owner_set(E_Appinfo *eai, E_Appinfo_Owner owner);
index 18775dc..404e0cf 100644 (file)
@@ -5782,6 +5782,12 @@ e_client_base_output_resolution_update(E_Client *ec)
         goto use_configured;
      }
 
+   if (!e_appinfo_base_output_resolution_available_get(eai))
+     {
+        ELOGF("POL_APPINFO", "NO AVAILABLE BASE SCREEN RESOLUTION... QUERY base_output_resolution", ec);
+        e_policy_base_output_resolution_info_update(ec->netwm.pid);
+     }
+
    if (!e_appinfo_base_output_resolution_get(eai, &width, &height))
      {
         ELOGF("POL_APPINFO", "NO BASE SCREEN RESOLUTION... USE configured_output_resolution(%d,%d) pid:%d", ec,
index 34a0fdb..3e9e26e 100644 (file)
@@ -1922,6 +1922,12 @@ e_policy_quickpanel_type_get(E_Client *ec)
 }
 
 EINTERN void
+e_policy_base_output_resolution_info_update(pid_t pid)
+{
+   e_policy_wl_base_output_resolution_info_update(pid);
+}
+
+EINTERN void
 e_policy_interceptors_clean(void)
 {
    E_Policy_Interceptor *pi;
index 194a281..ac4cee9 100644 (file)
@@ -285,6 +285,7 @@ EINTERN Eina_Bool        e_policy_interceptor_call(E_Policy_Intercept_Point ipoi
 
 EINTERN void             e_policy_event_simple(E_Client *ec, int type);
 
+EINTERN void             e_policy_base_output_resolution_info_update(pid_t pid);
 
 EINTERN Eina_Bool e_policy_aux_message_use_get(E_Client *ec);
 E_API void      e_policy_aux_message_send(E_Client *ec, const char *key, const char *val, Eina_List *options);
index 2c9c0c4..5210d67 100644 (file)
@@ -7504,7 +7504,7 @@ _tzlaunch_appinfo_iface_cb_set_appid(struct wl_client *client, struct wl_resourc
      {
 
         // 1. send HOOK with pid
-        _e_policy_wl_hook_call(E_POLICY_WL_HOOK_BASE_OUTPUT_RESOLUTION_GET, pid);
+        e_policy_wl_base_output_resolution_info_update(pid);
         // 2. module must set the base_output_resolution.
         if (!e_appinfo_base_output_resolution_get(eai, &width, &height))
           {
@@ -7681,7 +7681,7 @@ _tzlaunch_appinfo_iface_cb_ready_metadata(struct wl_client *client, struct wl_re
    if (e_config->configured_output_resolution.use)
      {
         // 1. send HOOK with pid
-        _e_policy_wl_hook_call(E_POLICY_WL_HOOK_BASE_OUTPUT_RESOLUTION_GET, pid);
+        e_policy_wl_base_output_resolution_info_update(pid);
         // 2. module must set the base_output_resolution.
         if (!e_appinfo_base_output_resolution_get(eai, &width, &height))
           {
@@ -7807,6 +7807,12 @@ err:
    wl_client_post_no_memory(client);
 }
 
+EINTERN void
+e_policy_wl_base_output_resolution_info_update(pid_t pid)
+{
+   _e_policy_wl_hook_call(E_POLICY_WL_HOOK_BASE_OUTPUT_RESOLUTION_GET, pid);
+}
+
 static Eina_Bool
 _e_policy_wl_cb_hook_intercept_show_helper(void *data, E_Client *ec)
 {
index 57a89ae..cce30c1 100644 (file)
@@ -103,4 +103,7 @@ E_API void e_policy_wl_activate(E_Client *ec);
 /* util */
 EINTERN void e_policy_wl_generate_request(E_Client *ec, E_Policy_Wl_Gen_Request type);
 
+/* appinfo */
+EINTERN void e_policy_wl_base_output_resolution_info_update(pid_t pid);
+
 #endif /* E_MOD_WL_H */