e_client: add e_client_base_output_resolution_rsm_update function 06/224406/2
authorSooChan Lim <sc1.lim@samsung.com>
Mon, 10 Feb 2020 08:05:40 +0000 (17:05 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Mon, 10 Feb 2020 10:20:34 +0000 (19:20 +0900)
This function changes the base_output_resolution of the bind_ec
by checking the base_output_resolution of provider_ec's appinfo.

Change-Id: I2efcca59c4a878c3f36e06e0f09ef30ccd59b628

src/bin/e_client.c
src/bin/e_client.h

index 3ba3045d8e096a0b54fceb09c629719f6573b666..091aa0ef0f85b2eee81980b0a7d438f447361738 100644 (file)
@@ -7577,6 +7577,94 @@ e_client_base_output_resolution_useful_geometry_get(E_Client *ec, int *x, int *y
    return EINA_TRUE;
 }
 
+/* change the base_output_resolution of the bind_ec by checking the base_output_resolution of provider_ec's appinfo */
+EINTERN Eina_Bool
+e_client_base_output_resolution_rsm_update(E_Client *bind_ec, E_Client *provider_ec)
+{
+   E_Appinfo *epai = NULL;
+   int configured_width, configured_height;
+   int width, height;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(bind_ec, EINA_FALSE);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(provider_ec, EINA_FALSE);
+
+  if (!e_config->configured_output_resolution.use) return EINA_TRUE;
+
+  configured_width = e_config->configured_output_resolution.w;
+  configured_height = e_config->configured_output_resolution.h;
+
+  if (bind_ec->base_output_resolution.use)
+    {
+       ELOGF("POL_APPINFO", "DELETE EXISTED BINDER BASE SCREEN RESOLUTION... base_output_resolution is same with desk size:(%d,%d), bind_pid:%d", bind_ec,
+             bind_ec->base_output_resolution.w, bind_ec->base_output_resolution.h, bind_ec->netwm.pid);
+
+       bind_ec->base_output_resolution.use = 0;
+       bind_ec->base_output_resolution.w = 0;
+       bind_ec->base_output_resolution.h = 0;
+       e_client_transform_core_remove(bind_ec, bind_ec->base_output_resolution.transform);
+       E_FREE_FUNC(bind_ec->base_output_resolution.transform, e_util_transform_del);
+    }
+
+  if (!provider_ec->netwm.pid)
+    {
+       ELOGF("POL_APPINFO", "NO PROVIDER PID... USE configured_output_resolution(%d,%d) provider_pid:%d", provider_ec,
+             configured_width, configured_height, provider_ec->netwm.pid);
+       goto use_configured;
+    }
+
+   epai = e_appinfo_find_with_pid(provider_ec->netwm.pid);
+   if (!epai)
+     {
+        ELOGF("POL_APPINFO", "NO PROVIDER APPINFO... USE configured_output_resolution(%d,%d) provider_pid:%d", provider_ec,
+              configured_width, configured_height, provider_ec->netwm.pid);
+        goto use_configured;
+     }
+
+   if (!e_appinfo_base_output_resolution_get(epai, &width, &height))
+     {
+        ELOGF("POL_APPINFO", "NO PROVIDER APPINFO BASE SCREEN RESOLUTION... USE configured_output_resolution(%d,%d) provider_pid:%d", provider_ec,
+              configured_width, configured_height, provider_ec->netwm.pid);
+        goto use_configured;
+      }
+
+   if ((width == 0) && (height == 0))
+     {
+        ELOGF("POL_APPINFO", "NO PROVIDER WIDTH and HEIGHT... SKIP base_output_resolution due to size:(%d,%d) provider_pid:%d", provider_ec,
+             width, height, provider_ec->netwm.pid);
+        return EINA_TRUE;
+     }
+
+   if ((bind_ec->desk->geom.w == width) && (bind_ec->desk->geom.h == height))
+     {
+        ELOGF("POL_APPINFO", "SKIP SET BINDER BASE SCREEN RESOLUTION... base_output_resolution is same with desk size:(%d,%d), bind_pid:%d", bind_ec,
+            width, height, bind_ec->netwm.pid);
+        return EINA_TRUE;
+     }
+
+   /* set the base_output_resolution of the e_client */
+   _e_client_base_output_resolution_set(bind_ec, width, height);
+   e_client_base_output_resolution_transform_adjust(bind_ec);
+
+   ELOGF("POL_APPINFO", "USE BINDER base_output_resolution(%d,%d) bind_pid:%d", bind_ec, width, height, bind_ec->netwm.pid);
+
+   return EINA_TRUE;
+
+use_configured:
+
+   if ((bind_ec->desk->geom.w == configured_width) && (bind_ec->desk->geom.h == configured_height))
+     {
+        ELOGF("POL_APPINFO", "SKIP BINDER use configured_output_resolution (same with desk size:(%d,%d), bind_pid:%d)", bind_ec,
+             configured_width, configured_height, bind_ec->netwm.pid);
+     }
+   else
+     {
+        /* set the base_output_resolution of the e_client as a default */
+        _e_client_base_output_resolution_set(bind_ec, configured_width, configured_height);
+     }
+
+   return EINA_TRUE;
+}
+
 /* tizen_move_resize */
 EINTERN Eina_Bool
 e_client_pending_geometry_has(E_Client *ec)
index 2057e90b1cba4856aedce033eba478f3f48aaa2f..971ecd64d1b075b85dbb90501ba56ea69eb22bcf 100644 (file)
@@ -1196,6 +1196,7 @@ E_API E_Capture_Save_State e_client_image_save(E_Client *ec, const char *dir, co
 E_API void      e_client_base_output_resolution_transform_adjust(E_Client *ec);
 E_API Eina_Bool e_client_base_output_resolution_update(E_Client *ec);
 E_API Eina_Bool e_client_base_output_resolution_useful_geometry_get(E_Client *ec, int *x, int *y, int *w, int *h);
+EINTERN Eina_Bool e_client_base_output_resolution_rsm_update(E_Client *bind_ec, E_Client *provider_ec);
 
 E_API void e_client_focus_skip_set(E_Client *ec, Eina_Bool skip, Eina_Bool by_client);
 EINTERN void e_client_revert_focus(E_Client *ec);