e_comp_wl: adjust mouse in pointer when reload the cursor 06/221206/1
authorjeon <jhyuni.kang@samsung.com>
Mon, 30 Dec 2019 06:21:14 +0000 (15:21 +0900)
committerJeongHyun Kang <jhyuni.kang@samsung.com>
Mon, 30 Dec 2019 06:19:48 +0000 (06:19 +0000)
Change-Id: I1bccc7df04b4bde8de8eb69c8f9fd20ad9acbd40

src/bin/e_comp_wl.c

index 376ba4e2a9fd37c5f9d2c2d9dacef4e305ea1740..e656efb0c1dc1c998186095bb8d5a51295d794ac 100644 (file)
@@ -809,7 +809,7 @@ _e_comp_wl_cursor_reload(E_Client *ec)
    struct wl_client *wc;
    Eina_List *l;
    uint32_t serial;
-   int cx, cy;
+   int cx, cy, px, py;
 
    if (e_comp->pointer->o_ptr && (!evas_object_visible_get(e_comp->pointer->o_ptr)))
      e_pointer_object_set(e_comp->pointer, NULL, 0, 0);
@@ -818,8 +818,19 @@ _e_comp_wl_cursor_reload(E_Client *ec)
    if (e_object_is_del(E_OBJECT(ec))) return;
    if (!ec->comp_data || !ec->comp_data->surface) return;
 
-   cx = wl_fixed_to_int(e_comp_wl->ptr.x) - ec->client.x;
-   cy = wl_fixed_to_int(e_comp_wl->ptr.y) - ec->client.y;
+   px = wl_fixed_to_int(e_comp_wl->ptr.x);
+   py = wl_fixed_to_int(e_comp_wl->ptr.y);
+
+   if (evas_object_map_enable_get(ec->frame))
+     {
+        double dx = 0.0, dy = 0.0;
+        evas_map_coords_get(evas_object_map_get(ec->frame), (double)px, (double)py, &dx, &dy, 0);
+        px = (int)dx;
+        py = (int)dy;
+     }
+
+   cx = px - ec->client.x;
+   cy = py - ec->client.y;
 
    wc = wl_resource_get_client(ec->comp_data->surface);
    serial = wl_display_next_serial(e_comp_wl->wl.disp);