From 37b173f326d89a43812dfab5846a3f04400ff94a Mon Sep 17 00:00:00 2001 From: emersion Date: Fri, 6 Apr 2018 17:50:12 -0400 Subject: When moving between outputs, use output center as reference --- sway/tree/layout.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sway/tree/layout.c b/sway/tree/layout.c index 5dbf4830..77b2448a 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c @@ -308,14 +308,11 @@ void container_move(struct sway_container *container, case C_OUTPUT: { enum wlr_direction wlr_dir; sway_dir_to_wlr(move_dir, &wlr_dir); - double ref_x = current->x + current->width / 2; - double ref_y = current->y + current->height / 2; - ref_x += current->sway_output->swayc->x; - ref_y += current->sway_output->swayc->y; + double ref_lx = current->x + current->width / 2; + double ref_ly = current->y + current->height / 2; struct wlr_output *next = wlr_output_layout_adjacent_output( root_container.sway_root->output_layout, wlr_dir, - current->sway_output->wlr_output, - current->x, current->y); + current->sway_output->wlr_output, ref_lx, ref_ly); if (!next) { wlr_log(L_DEBUG, "Hit edge of output, nowhere else to go"); return; -- cgit v1.2.3-54-g00ecf