diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-30 21:20:31 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-09-05 18:01:43 +1000 |
commit | acc2628c799170dea98380cda2237137137f182f (patch) | |
tree | b28b186339b90b75a767b96c780f9a643ff70204 /sway/tree | |
parent | Implement type safe arguments and demote sway_container (diff) | |
download | sway-acc2628c799170dea98380cda2237137137f182f.tar.gz sway-acc2628c799170dea98380cda2237137137f182f.tar.zst sway-acc2628c799170dea98380cda2237137137f182f.zip |
Don't use wlr_output properties
These properties are before rotation.
Diffstat (limited to 'sway/tree')
-rw-r--r-- | sway/tree/arrange.c | 4 | ||||
-rw-r--r-- | sway/tree/output.c | 19 | ||||
-rw-r--r-- | sway/tree/view.c | 8 | ||||
-rw-r--r-- | sway/tree/workspace.c | 8 |
4 files changed, 22 insertions, 17 deletions
diff --git a/sway/tree/arrange.c b/sway/tree/arrange.c index f86d4a74..2cccf65a 100644 --- a/sway/tree/arrange.c +++ b/sway/tree/arrange.c | |||
@@ -219,8 +219,8 @@ void arrange_workspace(struct sway_workspace *workspace) { | |||
219 | struct sway_container *fs = workspace->fullscreen; | 219 | struct sway_container *fs = workspace->fullscreen; |
220 | fs->x = output->wlr_output->lx; | 220 | fs->x = output->wlr_output->lx; |
221 | fs->y = output->wlr_output->ly; | 221 | fs->y = output->wlr_output->ly; |
222 | fs->width = output->wlr_output->width; | 222 | fs->width = output->width; |
223 | fs->height = output->wlr_output->height; | 223 | fs->height = output->height; |
224 | arrange_container(fs); | 224 | arrange_container(fs); |
225 | } else { | 225 | } else { |
226 | struct wlr_box box; | 226 | struct wlr_box box; |
diff --git a/sway/tree/output.c b/sway/tree/output.c index d72eb1a1..afc336f8 100644 --- a/sway/tree/output.c +++ b/sway/tree/output.c | |||
@@ -75,6 +75,11 @@ void output_enable(struct sway_output *output, struct output_config *oc) { | |||
75 | apply_output_config(oc, output); | 75 | apply_output_config(oc, output); |
76 | list_add(root->outputs, output); | 76 | list_add(root->outputs, output); |
77 | 77 | ||
78 | output->lx = wlr_output->lx; | ||
79 | output->ly = wlr_output->ly; | ||
80 | wlr_output_transformed_resolution(wlr_output, | ||
81 | &output->width, &output->height); | ||
82 | |||
78 | restore_workspaces(output); | 83 | restore_workspaces(output); |
79 | 84 | ||
80 | if (!output->workspaces->length) { | 85 | if (!output->workspaces->length) { |
@@ -265,8 +270,8 @@ struct sway_output *output_get_in_direction(struct sway_output *reference, | |||
265 | "got invalid direction: %d", direction)) { | 270 | "got invalid direction: %d", direction)) { |
266 | return NULL; | 271 | return NULL; |
267 | } | 272 | } |
268 | int lx = reference->wlr_output->lx + reference->wlr_output->width / 2; | 273 | int lx = reference->wlr_output->lx + reference->width / 2; |
269 | int ly = reference->wlr_output->ly + reference->wlr_output->height / 2; | 274 | int ly = reference->wlr_output->ly + reference->height / 2; |
270 | struct wlr_output *wlr_adjacent = wlr_output_layout_adjacent_output( | 275 | struct wlr_output *wlr_adjacent = wlr_output_layout_adjacent_output( |
271 | root->output_layout, wlr_dir, reference->wlr_output, lx, ly); | 276 | root->output_layout, wlr_dir, reference->wlr_output, lx, ly); |
272 | if (!wlr_adjacent) { | 277 | if (!wlr_adjacent) { |
@@ -346,10 +351,10 @@ void output_sort_workspaces(struct sway_output *output) { | |||
346 | } | 351 | } |
347 | 352 | ||
348 | void output_get_box(struct sway_output *output, struct wlr_box *box) { | 353 | void output_get_box(struct sway_output *output, struct wlr_box *box) { |
349 | box->x = output->wlr_output->lx; | 354 | box->x = output->lx; |
350 | box->y = output->wlr_output->ly; | 355 | box->y = output->ly; |
351 | box->width = output->wlr_output->width; | 356 | box->width = output->width; |
352 | box->height = output->wlr_output->height; | 357 | box->height = output->height; |
353 | } | 358 | } |
354 | 359 | ||
355 | enum sway_container_layout output_get_default_layout( | 360 | enum sway_container_layout output_get_default_layout( |
@@ -360,7 +365,7 @@ enum sway_container_layout output_get_default_layout( | |||
360 | if (config->default_orientation != L_NONE) { | 365 | if (config->default_orientation != L_NONE) { |
361 | return config->default_orientation; | 366 | return config->default_orientation; |
362 | } | 367 | } |
363 | if (output->wlr_output->height > output->wlr_output->width) { | 368 | if (output->height > output->width) { |
364 | return L_VERT; | 369 | return L_VERT; |
365 | } | 370 | } |
366 | return L_HORIZ; | 371 | return L_HORIZ; |
diff --git a/sway/tree/view.c b/sway/tree/view.c index 452c2bd1..ff63df2d 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -167,10 +167,10 @@ void view_autoconfigure(struct sway_view *view) { | |||
167 | struct sway_output *output = view->container->workspace->output; | 167 | struct sway_output *output = view->container->workspace->output; |
168 | 168 | ||
169 | if (view->container->is_fullscreen) { | 169 | if (view->container->is_fullscreen) { |
170 | view->x = output->wlr_output->lx; | 170 | view->x = output->lx; |
171 | view->y = output->wlr_output->ly; | 171 | view->y = output->ly; |
172 | view->width = output->wlr_output->width; | 172 | view->width = output->width; |
173 | view->height = output->wlr_output->height; | 173 | view->height = output->height; |
174 | return; | 174 | return; |
175 | } | 175 | } |
176 | 176 | ||
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c index 38ee478e..bb1ded22 100644 --- a/sway/tree/workspace.c +++ b/sway/tree/workspace.c | |||
@@ -53,10 +53,10 @@ struct sway_workspace *workspace_create(struct sway_output *output, | |||
53 | return NULL; | 53 | return NULL; |
54 | } | 54 | } |
55 | node_init(&ws->node, N_WORKSPACE, ws); | 55 | node_init(&ws->node, N_WORKSPACE, ws); |
56 | ws->x = output->wlr_output->lx; | 56 | ws->x = output->lx; |
57 | ws->y = output->wlr_output->ly; | 57 | ws->y = output->ly; |
58 | ws->width = output->wlr_output->width; | 58 | ws->width = output->width; |
59 | ws->height = output->wlr_output->height; | 59 | ws->height = output->height; |
60 | ws->name = name ? strdup(name) : NULL; | 60 | ws->name = name ? strdup(name) : NULL; |
61 | ws->prev_split_layout = L_NONE; | 61 | ws->prev_split_layout = L_NONE; |
62 | ws->layout = output_get_default_layout(output); | 62 | ws->layout = output_get_default_layout(output); |