aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2018-09-07 15:43:15 +0200
committerLibravatar emersion <contact@emersion.fr>2018-09-07 15:43:15 +0200
commit251a7ebc4ba1dd24e9bc6b3cfd6883c80f429a2f (patch)
tree0c719df34d250397e9b2731c50f3ee6bb3acf38a
parentMerge pull request #2569 from RyanDwyer/deny-reload-repeat (diff)
downloadsway-251a7ebc4ba1dd24e9bc6b3cfd6883c80f429a2f.tar.gz
sway-251a7ebc4ba1dd24e9bc6b3cfd6883c80f429a2f.tar.zst
sway-251a7ebc4ba1dd24e9bc6b3cfd6883c80f429a2f.zip
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 c30e52a1..0dbb88b8 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,
80 int sw = surface->current.width; 80 int sw = surface->current.width;
81 int sh = surface->current.height; 81 int sh = surface->current.height;
82 82
83 double _sx = sx, _sy = sy; 83 double _sx = sx + surface->sx;
84 double _sy = sy + surface->sy;
84 rotate_child_position(&_sx, &_sy, sw, sh, data->width, data->height, 85 rotate_child_position(&_sx, &_sy, sw, sh, data->width, data->height,
85 data->rotation); 86 data->rotation);
86 87
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index 00240e84..b35fa732 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -408,6 +408,7 @@ void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec,
408 } 408 }
409 409
410 struct sway_seat *seat = cursor->seat; 410 struct sway_seat *seat = cursor->seat;
411 struct wlr_seat *wlr_seat = seat->wlr_seat;
411 412
412 if (seat->operation != OP_NONE) { 413 if (seat->operation != OP_NONE) {
413 switch (seat->operation) { 414 switch (seat->operation) {
@@ -431,7 +432,6 @@ void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec,
431 return; 432 return;
432 } 433 }
433 434
434 struct wlr_seat *wlr_seat = seat->wlr_seat;
435 struct wlr_surface *surface = NULL; 435 struct wlr_surface *surface = NULL;
436 double sx, sy; 436 double sx, sy;
437 437
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 4b7c7893..3dbb6ce4 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -240,16 +240,16 @@ void drag_icon_update_position(struct sway_drag_icon *icon) {
240 struct sway_seat *seat = icon->seat; 240 struct sway_seat *seat = icon->seat;
241 struct wlr_cursor *cursor = seat->cursor->cursor; 241 struct wlr_cursor *cursor = seat->cursor->cursor;
242 if (wlr_icon->is_pointer) { 242 if (wlr_icon->is_pointer) {
243 icon->x = cursor->x + wlr_icon->sx; 243 icon->x = cursor->x;
244 icon->y = cursor->y + wlr_icon->sy; 244 icon->y = cursor->y;
245 } else { 245 } else {
246 struct wlr_touch_point *point = 246 struct wlr_touch_point *point =
247 wlr_seat_touch_get_point(seat->wlr_seat, wlr_icon->touch_id); 247 wlr_seat_touch_get_point(seat->wlr_seat, wlr_icon->touch_id);
248 if (point == NULL) { 248 if (point == NULL) {
249 return; 249 return;
250 } 250 }
251 icon->x = seat->touch_x + wlr_icon->sx; 251 icon->x = seat->touch_x;
252 icon->y = seat->touch_y + wlr_icon->sy; 252 icon->y = seat->touch_y;
253 } 253 }
254 254
255 drag_icon_damage_whole(icon); 255 drag_icon_damage_whole(icon);
@@ -308,6 +308,7 @@ static void handle_new_drag_icon(struct wl_listener *listener, void *data) {
308 wl_list_insert(&root_container.sway_root->drag_icons, &icon->link); 308 wl_list_insert(&root_container.sway_root->drag_icons, &icon->link);
309 309
310 drag_icon_update_position(icon); 310 drag_icon_update_position(icon);
311 seat_end_mouse_operation(seat);
311} 312}
312 313
313static void collect_focus_iter(struct sway_container *con, void *data) { 314static void collect_focus_iter(struct sway_container *con, void *data) {