aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/layout.c
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-05-27 09:46:40 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-06-01 23:14:58 +1000
commit40af5d81a1da972cdd59ecb0372ee756433aba26 (patch)
tree497a12188ecfd21f4c1a3eecf61ced340bac2449 /sway/tree/layout.c
parentbecceafa7f12f1a1668daca0b27c4102282d9076 (diff)
Fix getting adjacent output
Diffstat (limited to 'sway/tree/layout.c')
-rw-r--r--sway/tree/layout.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/sway/tree/layout.c b/sway/tree/layout.c
index 28775253..d88948dc 100644
--- a/sway/tree/layout.c
+++ b/sway/tree/layout.c
@@ -680,26 +680,6 @@ static struct sway_container *get_swayc_in_output_direction(
return ws;
}
-static void get_layout_center_position(struct sway_container *container,
- int *x, int *y) {
- // FIXME view coords are inconsistently referred to in layout/output systems
- if (container->type == C_OUTPUT) {
- *x = container->x + container->width/2;
- *y = container->y + container->height/2;
- } else {
- struct sway_container *output = container_parent(container, C_OUTPUT);
- if (container->type == C_WORKSPACE) {
- // Workspace coordinates are actually wrong/arbitrary, but should
- // be same as output.
- *x = output->x;
- *y = output->y;
- } else {
- *x = output->x + container->x;
- *y = output->y + container->y;
- }
- }
-}
-
static struct sway_container *sway_output_from_wlr(struct wlr_output *output) {
if (output == NULL) {
return NULL;
@@ -755,8 +735,8 @@ struct sway_container *container_get_in_direction(
"got invalid direction: %d", dir)) {
return NULL;
}
- int lx, ly;
- get_layout_center_position(container, &lx, &ly);
+ int lx = container->x + container->width / 2;
+ int ly = container->y + container->height / 2;
struct wlr_output_layout *layout =
root_container.sway_root->output_layout;
struct wlr_output *wlr_adjacent =