diff options
author | nyorain <nyorain@gmail.com> | 2018-09-07 14:48:28 +0200 |
---|---|---|
committer | nyorain <nyorain@gmail.com> | 2018-09-07 14:48:28 +0200 |
commit | f6168c2afeece02b118b2bc43412fc3344e59028 (patch) | |
tree | d3e71fffbcb8d5f0c0ed986bdef0e73f2a68a952 | |
parent | 8898f3199a99f3953e08a9312ad993712e434f71 (diff) |
Fix #1129 and remove sx, sy from wlr_drag_icon
sx, sy used to store the buffer offset of the drag surface which was
then be added (by rootston) to the drag icon position.
Buffer offsets are handled already in surface_intersect_output
(output.c) so they were added twice for dnd surfaces.
-rw-r--r-- | include/wlr/types/wlr_data_device.h | 2 | ||||
-rw-r--r-- | rootston/seat.c | 8 | ||||
-rw-r--r-- | types/data_device/wlr_drag.c | 3 |
3 files changed, 4 insertions, 9 deletions
diff --git a/include/wlr/types/wlr_data_device.h b/include/wlr/types/wlr_data_device.h index cc04c9e9..c45e8d1c 100644 --- a/include/wlr/types/wlr_data_device.h +++ b/include/wlr/types/wlr_data_device.h @@ -93,8 +93,6 @@ struct wlr_drag_icon { bool is_pointer; int32_t touch_id; - int32_t sx, sy; - struct { struct wl_signal map; struct wl_signal unmap; diff --git a/rootston/seat.c b/rootston/seat.c index 9010d6e3..c11ff017 100644 --- a/rootston/seat.c +++ b/rootston/seat.c @@ -502,16 +502,16 @@ void roots_drag_icon_update_position(struct roots_drag_icon *icon) { struct roots_seat *seat = icon->seat; struct wlr_cursor *cursor = seat->cursor->cursor; if (wlr_icon->is_pointer) { - icon->x = cursor->x + wlr_icon->sx; - icon->y = cursor->y + wlr_icon->sy; + icon->x = cursor->x; + icon->y = cursor->y; } else { struct wlr_touch_point *point = wlr_seat_touch_get_point(seat->seat, wlr_icon->touch_id); if (point == NULL) { return; } - icon->x = seat->touch_x + wlr_icon->sx; - icon->y = seat->touch_y + wlr_icon->sy; + icon->x = seat->touch_x; + icon->y = seat->touch_y; } roots_drag_icon_damage_whole(icon); diff --git a/types/data_device/wlr_drag.c b/types/data_device/wlr_drag.c index 7f3b346d..fcde7b3e 100644 --- a/types/data_device/wlr_drag.c +++ b/types/data_device/wlr_drag.c @@ -345,9 +345,6 @@ static void drag_icon_surface_role_commit(struct wlr_surface *surface) { return; } - icon->sx += icon->surface->current.dx; - icon->sy += icon->surface->current.dy; - drag_icon_set_mapped(icon, wlr_surface_has_buffer(surface)); } |