e_comp_wl: adjust mouse in pointer when reload the cursor 05/221205/2
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:36 +0000 (06:19 +0000)
Change-Id: I1bccc7df04b4bde8de8eb69c8f9fd20ad9acbd40

src/bin/e_comp_wl.c

index 7edf0024daf8f376c6b20855e22d64bfe8918e4c..d2e2d41933a68fec4b1467bf3f3710f60a21bfc1 100644 (file)
@@ -848,7 +848,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);
@@ -857,8 +857,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);