diff options
author | emersion <contact@emersion.fr> | 2018-04-06 17:50:12 -0400 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-04-06 17:50:12 -0400 |
commit | 37b173f326d89a43812dfab5846a3f04400ff94a (patch) | |
tree | 223c9b3a7789b09f15b307c6ebbdbe209edadb86 | |
parent | Container coordiantes/sizes are floating point (diff) | |
download | sway-37b173f326d89a43812dfab5846a3f04400ff94a.tar.gz sway-37b173f326d89a43812dfab5846a3f04400ff94a.tar.zst sway-37b173f326d89a43812dfab5846a3f04400ff94a.zip |
When moving between outputs, use output center as reference
-rw-r--r-- | sway/tree/layout.c | 9 |
1 files 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, | |||
308 | case C_OUTPUT: { | 308 | case C_OUTPUT: { |
309 | enum wlr_direction wlr_dir; | 309 | enum wlr_direction wlr_dir; |
310 | sway_dir_to_wlr(move_dir, &wlr_dir); | 310 | sway_dir_to_wlr(move_dir, &wlr_dir); |
311 | double ref_x = current->x + current->width / 2; | 311 | double ref_lx = current->x + current->width / 2; |
312 | double ref_y = current->y + current->height / 2; | 312 | double ref_ly = current->y + current->height / 2; |
313 | ref_x += current->sway_output->swayc->x; | ||
314 | ref_y += current->sway_output->swayc->y; | ||
315 | struct wlr_output *next = wlr_output_layout_adjacent_output( | 313 | struct wlr_output *next = wlr_output_layout_adjacent_output( |
316 | root_container.sway_root->output_layout, wlr_dir, | 314 | root_container.sway_root->output_layout, wlr_dir, |
317 | current->sway_output->wlr_output, | 315 | current->sway_output->wlr_output, ref_lx, ref_ly); |
318 | current->x, current->y); | ||
319 | if (!next) { | 316 | if (!next) { |
320 | wlr_log(L_DEBUG, "Hit edge of output, nowhere else to go"); | 317 | wlr_log(L_DEBUG, "Hit edge of output, nowhere else to go"); |
321 | return; | 318 | return; |