e_mod_main: Send corrected x coord based on transform of input panel and client 39/310839/1 accepted/tizen/8.0/unified/20240514.160755
authorJunseok Kim <juns.kim@samsung.com>
Thu, 2 May 2024 12:36:00 +0000 (21:36 +0900)
committerInHong Han <inhong1.han@samsung.com>
Thu, 9 May 2024 01:55:25 +0000 (01:55 +0000)
The coords of input panel was not consider the transform since using base output resolution.
However, It didn't matter that almost clients using base output resolution.

Multiple clients can now be displayed in multiple sizes without using the transform.
This caused a problem where the client created an entry in the wrong location if the untransformed geometry of the input panel was delivered as it is.

To fix this problem, modifiy to send the input panel geometry considering the transform of input panel and the client.

NOTE: If the same applies to the y coordinate, the y coordinate problem occurs in some C# apps.
Temporarily only the x coordinate was modified.

Change-Id: I1285b378b82320ad71f29135c1c4d79d9ba147f7

src/e_mod_main.c

index 4dc2435966fe37ca64c7ef8d606dcf072a010564..130d61f1758b200fe9d076c510625c9170110511 100644 (file)
@@ -202,6 +202,12 @@ _e_text_input_send_input_panel_geometry(struct wl_resource *resource, int x, int
    int angle = 0;
    char geometry[128];
    int new_x = x;
+   int new_y = y;
+   int new_w = w;
+   int new_h = h;
+
+   E_Client *ips_ec = NULL;
+   Eina_List *l;
 
    if (client_surface_ec)
      {
@@ -209,19 +215,33 @@ _e_text_input_send_input_panel_geometry(struct wl_resource *resource, int x, int
                 client_surface_ec->e.state.rot.ang.curr :
                 client_surface_ec->e.state.rot.ang.next;
 
+        // find input panel
+        EINA_LIST_FOREACH(client_surface_ec->transients, l, ips_ec)
+          {
+             if (e_input_panel_client_find(ips_ec)) break;
+          }
+
         LOGI("curr : %d, next : %d, angle : %d\n", client_surface_ec->e.state.rot.ang.curr,
-           client_surface_ec->e.state.rot.ang.next, angle);
+             client_surface_ec->e.state.rot.ang.next, angle);
 
-        if (!(e_input_panel_floating_mode_get()))
+        if (ips_ec && !(e_input_panel_floating_mode_get()))
           {
-             int client_y, client_w, client_h;
-             e_client_base_output_resolution_desk_useful_geometry_get(client_surface_ec, &new_x, &client_y, &client_w, &client_h, EINA_TRUE);
+             if (e_client_transform_core_enable_get(ips_ec))
+               {
+                  e_client_transform_core_input_inv_transform(ips_ec, x, y, &new_x, &new_y);
+                  e_client_transform_core_input_inv_transform(ips_ec, w, h, &new_w, &new_h);
+                  LOGI("input panel using transform. (%d, %d, %dx%d) -> (%d, %d, %dx%d)", x, y, w, h, new_x, new_y, new_w, new_h);
 
-             if (angle == 0 || angle == 180)
-               new_x = (client_w - w) / 2;
-             else
-               new_x = (client_h - w) / 2;
+                  if (e_client_transform_core_enable_get(client_surface_ec))
+                    {
+                       e_client_transform_core_input_transform(client_surface_ec, new_x, new_y, &new_x, &new_y);
+                       e_client_transform_core_input_transform(client_surface_ec, new_w, new_h, &new_w, &new_h);
+                       LOGI("client_surface_ec using transform. (%d, %d, %dx%d) -> (%d, %d, %dx%d)", x, y, w, h, new_x, new_y, new_w, new_h);
+                    }
+               }
           }
+        else if (!ips_ec)
+          LOGI("couldn't find input panel client");
      }
 
    snprintf(geometry, sizeof(geometry), "%d,%d,%d,%d", new_x, y, w, h);