ecore_evas_x: correctly use offset of the drag window

This commit is contained in:
Marcel Hollerbach 2022-05-31 21:16:24 +02:00
parent af6134aa6c
commit c3d1f19ed8
1 changed files with 13 additions and 2 deletions

View File

@ -4451,11 +4451,22 @@ static void
_x11_drag_move(void *data, Ecore_X_Xdnd_Position *pos) _x11_drag_move(void *data, Ecore_X_Xdnd_Position *pos)
{ {
Ecore_Evas *ee = data; Ecore_Evas *ee = data;
Eina_Rect rect; Eina_Size2D offset;
Eina_Rect rect;
ecore_evas_geometry_get(ee->drag.rep, &rect.x, &rect.y, &rect.w, &rect.h); ecore_evas_geometry_get(ee->drag.rep, &rect.x, &rect.y, &rect.w, &rect.h);
ecore_evas_move(ee->drag.rep, pos->position.x - rect.w / 2, pos->position.y - rect.h/2); if (ee->drag.offset.w == INT_MAX)
offset.w = rect.size.w / -2;
else
offset.w = ee->drag.offset.w;
if (ee->drag.offset.h == INT_MAX)
offset.h = rect.size.h / -2;
else
offset.h = ee->drag.offset.h;
ecore_evas_move(ee->drag.rep, pos->position.x + offset.w, pos->position.y + offset.h);
} }
static Eina_Bool static Eina_Bool