aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/output.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-08-30 21:20:31 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-09-05 18:01:43 +1000
commitacc2628c799170dea98380cda2237137137f182f (patch)
treeb28b186339b90b75a767b96c780f9a643ff70204 /sway/tree/output.c
parentImplement type safe arguments and demote sway_container (diff)
downloadsway-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/output.c')
-rw-r--r--sway/tree/output.c19
1 files changed, 12 insertions, 7 deletions
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
348void output_get_box(struct sway_output *output, struct wlr_box *box) { 353void 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
355enum sway_container_layout output_get_default_layout( 360enum 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;