diff options
author | emersion <contact@emersion.fr> | 2019-03-11 11:45:01 +0100 |
---|---|---|
committer | Brian Ashworth <bosrsf04@gmail.com> | 2019-03-11 12:43:01 -0400 |
commit | 076257a978ce5f93b9b1613e43a067e602b5b041 (patch) | |
tree | f87dcb88bee0097cbf741df180f17d06299087cf /sway/tree/output.c | |
parent | Fix size_t temporary underflow in log_loaded_themes (diff) | |
download | sway-076257a978ce5f93b9b1613e43a067e602b5b041.tar.gz sway-076257a978ce5f93b9b1613e43a067e602b5b041.tar.zst sway-076257a978ce5f93b9b1613e43a067e602b5b041.zip |
Stop using wlr_output->{lx,ly}
Also fixes sway_output->{lx,ly,width,height} not being updated. Also fixes
output_get_in_direction adding buffer coords to layout coords.
Diffstat (limited to 'sway/tree/output.c')
-rw-r--r-- | sway/tree/output.c | 11 |
1 files changed, 4 insertions, 7 deletions
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) { | |||
101 | output->configured = true; | 101 | output->configured = true; |
102 | list_add(root->outputs, output); | 102 | list_add(root->outputs, output); |
103 | 103 | ||
104 | output->lx = wlr_output->lx; | ||
105 | output->ly = wlr_output->ly; | ||
106 | wlr_output_transformed_resolution(wlr_output, | ||
107 | &output->width, &output->height); | ||
108 | |||
109 | restore_workspaces(output); | 104 | restore_workspaces(output); |
110 | 105 | ||
111 | struct sway_workspace *ws = NULL; | 106 | struct sway_workspace *ws = NULL; |
@@ -311,8 +306,10 @@ struct sway_output *output_get_in_direction(struct sway_output *reference, | |||
311 | if (!sway_assert(direction, "got invalid direction: %d", direction)) { | 306 | if (!sway_assert(direction, "got invalid direction: %d", direction)) { |
312 | return NULL; | 307 | return NULL; |
313 | } | 308 | } |
314 | int lx = reference->wlr_output->lx + reference->width / 2; | 309 | struct wlr_box *output_box = |
315 | int ly = reference->wlr_output->ly + reference->height / 2; | 310 | wlr_output_layout_get_box(root->output_layout, reference->wlr_output); |
311 | int lx = output_box->x + output_box->width / 2; | ||
312 | int ly = output_box->y + output_box->height / 2; | ||
316 | struct wlr_output *wlr_adjacent = wlr_output_layout_adjacent_output( | 313 | struct wlr_output *wlr_adjacent = wlr_output_layout_adjacent_output( |
317 | root->output_layout, direction, reference->wlr_output, lx, ly); | 314 | root->output_layout, direction, reference->wlr_output, lx, ly); |
318 | if (!wlr_adjacent) { | 315 | if (!wlr_adjacent) { |