aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-09-07 11:09:02 -0400
committerGitHub <noreply@github.com>2018-09-07 11:09:02 -0400
commit030b5bc02455bc936a9a7fedc05c3f9b7c813098 (patch)
treea0d6ee22a377a06d5d745ef4eb170895d74e55cd
parentd86afdc6ed72ec03fd2fe727132ee30476b82ae0 (diff)
parent251a7ebc4ba1dd24e9bc6b3cfd6883c80f429a2f (diff)
Merge pull request #2603 from emersion/fix-dnd
Fix drag-and-drop
-rw-r--r--sway/desktop/output.c3
-rw-r--r--sway/input/cursor.c2
-rw-r--r--sway/input/seat.c9
3 files changed, 8 insertions, 6 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index 7e9f7b7e..e49c4cca 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -80,7 +80,8 @@ static bool get_surface_box(struct surface_iterator_data *data,
int sw = surface->current.width;
int sh = surface->current.height;
- double _sx = sx, _sy = sy;
+ double _sx = sx + surface->sx;
+ double _sy = sy + surface->sy;
rotate_child_position(&_sx, &_sy, sw, sh, data->width, data->height,
data->rotation);
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index be3fc9c7..69a019bb 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -395,6 +395,7 @@ void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec,
}
struct sway_seat *seat = cursor->seat;
+ struct wlr_seat *wlr_seat = seat->wlr_seat;
if (seat->operation != OP_NONE) {
switch (seat->operation) {
@@ -418,7 +419,6 @@ void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec,
return;
}
- struct wlr_seat *wlr_seat = seat->wlr_seat;
struct wlr_surface *surface = NULL;
double sx, sy;
diff --git a/sway/input/seat.c b/sway/input/seat.c
index e86a2b81..5709a7f7 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -222,16 +222,16 @@ void drag_icon_update_position(struct sway_drag_icon *icon) {
struct sway_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->wlr_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;
}
drag_icon_damage_whole(icon);
@@ -289,6 +289,7 @@ static void handle_new_drag_icon(struct wl_listener *listener, void *data) {
wl_list_insert(&root->drag_icons, &icon->link);
drag_icon_update_position(icon);
+ seat_end_mouse_operation(seat);
}
static void collect_focus_iter(struct sway_node *node, void *data) {