diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-04-28 11:26:14 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-04-28 11:26:14 +1000 |
commit | 167c2e1aa99aa8011e169b0fb61c47953cc9a5f6 (patch) | |
tree | f312cac40cd542964f62d8b7ed53d44bb13dea37 /sway/desktop/output.c | |
parent | Merge pull request #1866 from ggreer/swaybar-cmd-sh (diff) | |
download | sway-167c2e1aa99aa8011e169b0fb61c47953cc9a5f6.tar.gz sway-167c2e1aa99aa8011e169b0fb61c47953cc9a5f6.tar.zst sway-167c2e1aa99aa8011e169b0fb61c47953cc9a5f6.zip |
Refactor arrange_windows()
Replaces arrange_windows() with arrange_root(), arrange_output(),
arrange_workspace() and arrange_children_of().
Also makes fullscreen views save and restore their dimensions, which
allows it to preserve any custom resize and is also a requirement for
floating views once they are implemented.
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r-- | sway/desktop/output.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index b19b72df..d9ae890f 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include "sway/layers.h" | 19 | #include "sway/layers.h" |
20 | #include "sway/output.h" | 20 | #include "sway/output.h" |
21 | #include "sway/server.h" | 21 | #include "sway/server.h" |
22 | #include "sway/tree/arrange.h" | ||
22 | #include "sway/tree/container.h" | 23 | #include "sway/tree/container.h" |
23 | #include "sway/tree/layout.h" | 24 | #include "sway/tree/layout.h" |
24 | #include "sway/tree/view.h" | 25 | #include "sway/tree/view.h" |
@@ -534,19 +535,19 @@ static void handle_destroy(struct wl_listener *listener, void *data) { | |||
534 | static void handle_mode(struct wl_listener *listener, void *data) { | 535 | static void handle_mode(struct wl_listener *listener, void *data) { |
535 | struct sway_output *output = wl_container_of(listener, output, mode); | 536 | struct sway_output *output = wl_container_of(listener, output, mode); |
536 | arrange_layers(output); | 537 | arrange_layers(output); |
537 | arrange_windows(output->swayc, -1, -1); | 538 | arrange_output(output->swayc); |
538 | } | 539 | } |
539 | 540 | ||
540 | static void handle_transform(struct wl_listener *listener, void *data) { | 541 | static void handle_transform(struct wl_listener *listener, void *data) { |
541 | struct sway_output *output = wl_container_of(listener, output, transform); | 542 | struct sway_output *output = wl_container_of(listener, output, transform); |
542 | arrange_layers(output); | 543 | arrange_layers(output); |
543 | arrange_windows(output->swayc, -1, -1); | 544 | arrange_output(output->swayc); |
544 | } | 545 | } |
545 | 546 | ||
546 | static void handle_scale(struct wl_listener *listener, void *data) { | 547 | static void handle_scale(struct wl_listener *listener, void *data) { |
547 | struct sway_output *output = wl_container_of(listener, output, scale); | 548 | struct sway_output *output = wl_container_of(listener, output, scale); |
548 | arrange_layers(output); | 549 | arrange_layers(output); |
549 | arrange_windows(output->swayc, -1, -1); | 550 | arrange_output(output->swayc); |
550 | } | 551 | } |
551 | 552 | ||
552 | void handle_new_output(struct wl_listener *listener, void *data) { | 553 | void handle_new_output(struct wl_listener *listener, void *data) { |
@@ -598,5 +599,5 @@ void handle_new_output(struct wl_listener *listener, void *data) { | |||
598 | output->damage_destroy.notify = damage_handle_destroy; | 599 | output->damage_destroy.notify = damage_handle_destroy; |
599 | 600 | ||
600 | arrange_layers(output); | 601 | arrange_layers(output); |
601 | arrange_windows(&root_container, -1, -1); | 602 | arrange_root(); |
602 | } | 603 | } |