Modified to adjust x position based on the output resolution of the client 81/309481/1
authorInhong Han <inhong1.han@samsung.com>
Thu, 11 Apr 2024 04:22:08 +0000 (13:22 +0900)
committerInhong Han <inhong1.han@samsung.com>
Thu, 11 Apr 2024 04:24:57 +0000 (13:24 +0900)
Change-Id: Ifebb50079b4867364dd4fdf513d1fb4fa38d6f8d

src/e_mod_main.c

index 630bcdfb65a9bf78247037c61ca2e7d586376696..c9e06d772d0dbcac3211d667629b142524401b2b 100644 (file)
@@ -200,6 +200,7 @@ _e_text_input_send_input_panel_geometry(struct wl_resource *resource, int x, int
 {
    int angle = 0;
    char geometry[128];
+   int new_x = x;
 
    if (client_surface_ec)
      {
@@ -209,9 +210,20 @@ _e_text_input_send_input_panel_geometry(struct wl_resource *resource, int x, int
 
         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);
+
+        if (!(e_input_panel_floating_mode_get()))
+          {
+             int client_y, client_w, client_h;
+             e_client_geometry_get(client_surface_ec, &new_x, &client_y, &client_w, &client_h);
+
+             if (angle == 0 || angle == 180)
+               new_x = (client_w - w) / 2;
+             else
+               new_x = (client_h - w) / 2;
+          }
      }
 
-   snprintf(geometry, sizeof(geometry), "%d,%d,%d,%d", x, y, w, h);
+   snprintf(geometry, sizeof(geometry), "%d,%d,%d,%d", new_x, y, w, h);
 
    switch(angle)
      {
@@ -224,9 +236,9 @@ _e_text_input_send_input_panel_geometry(struct wl_resource *resource, int x, int
          break;
      }
 
-   LOGI("angle : %d, x : %d, y : %d, w : %d, h : %d\n", angle, x, y, w, h);
+   LOGI("angle : %d, x : %d, y : %d, w : %d, h : %d\n", angle, new_x, y, w, h);
 
-   wl_text_input_send_input_panel_geometry(resource, x, y, w, h);
+   wl_text_input_send_input_panel_geometry(resource, new_x, y, w, h);
 }
 
 static gboolean