Merge pull request #1232 from nyorain/fix/dnd-offset

Fix #1129
This commit is contained in:
emersion 2018-09-07 15:22:16 +02:00 committed by GitHub
commit 085142ba34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 9 deletions

View file

@ -93,8 +93,6 @@ struct wlr_drag_icon {
bool is_pointer; bool is_pointer;
int32_t touch_id; int32_t touch_id;
int32_t sx, sy;
struct { struct {
struct wl_signal map; struct wl_signal map;
struct wl_signal unmap; struct wl_signal unmap;

View file

@ -502,16 +502,16 @@ void roots_drag_icon_update_position(struct roots_drag_icon *icon) {
struct roots_seat *seat = icon->seat; struct roots_seat *seat = icon->seat;
struct wlr_cursor *cursor = seat->cursor->cursor; struct wlr_cursor *cursor = seat->cursor->cursor;
if (wlr_icon->is_pointer) { if (wlr_icon->is_pointer) {
icon->x = cursor->x + wlr_icon->sx; icon->x = cursor->x;
icon->y = cursor->y + wlr_icon->sy; icon->y = cursor->y;
} else { } else {
struct wlr_touch_point *point = struct wlr_touch_point *point =
wlr_seat_touch_get_point(seat->seat, wlr_icon->touch_id); wlr_seat_touch_get_point(seat->seat, wlr_icon->touch_id);
if (point == NULL) { if (point == NULL) {
return; return;
} }
icon->x = seat->touch_x + wlr_icon->sx; icon->x = seat->touch_x;
icon->y = seat->touch_y + wlr_icon->sy; icon->y = seat->touch_y;
} }
roots_drag_icon_damage_whole(icon); roots_drag_icon_damage_whole(icon);

View file

@ -345,9 +345,6 @@ static void drag_icon_surface_role_commit(struct wlr_surface *surface) {
return; return;
} }
icon->sx += icon->surface->current.dx;
icon->sy += icon->surface->current.dy;
drag_icon_set_mapped(icon, wlr_surface_has_buffer(surface)); drag_icon_set_mapped(icon, wlr_surface_has_buffer(surface));
} }