diff options
Diffstat (limited to 'sway/tree')
-rw-r--r-- | sway/tree/arrange.c | 4 | ||||
-rw-r--r-- | sway/tree/output.c | 11 |
2 files changed, 6 insertions, 9 deletions
diff --git a/sway/tree/arrange.c b/sway/tree/arrange.c index 438a2133..8583c53e 100644 --- a/sway/tree/arrange.c +++ b/sway/tree/arrange.c @@ -195,8 +195,8 @@ void arrange_workspace(struct sway_workspace *workspace) { double prev_y = workspace->y; workspace->width = area->width; workspace->height = area->height; - workspace->x = output->wlr_output->lx + area->x; - workspace->y = output->wlr_output->ly + area->y; + workspace->x = output->lx + area->x; + workspace->y = output->ly + area->y; // Adjust any floating containers double diff_x = workspace->x - prev_x; diff --git a/sway/tree/output.c b/sway/tree/output.c index e0a66e0b..227d487c 100644 --- a/sway/tree/output.c +++ b/sway/tree/output.c @@ -101,11 +101,6 @@ void output_enable(struct sway_output *output, struct output_config *oc) { output->configured = true; list_add(root->outputs, output); - output->lx = wlr_output->lx; - output->ly = wlr_output->ly; - wlr_output_transformed_resolution(wlr_output, - &output->width, &output->height); - restore_workspaces(output); struct sway_workspace *ws = NULL; @@ -311,8 +306,10 @@ struct sway_output *output_get_in_direction(struct sway_output *reference, if (!sway_assert(direction, "got invalid direction: %d", direction)) { return NULL; } - int lx = reference->wlr_output->lx + reference->width / 2; - int ly = reference->wlr_output->ly + reference->height / 2; + struct wlr_box *output_box = + wlr_output_layout_get_box(root->output_layout, reference->wlr_output); + int lx = output_box->x + output_box->width / 2; + int ly = output_box->y + output_box->height / 2; struct wlr_output *wlr_adjacent = wlr_output_layout_adjacent_output( root->output_layout, direction, reference->wlr_output, lx, ly); if (!wlr_adjacent) { |