diff options
author | 2017-12-13 21:47:37 +0100 | |
---|---|---|
committer | 2017-12-13 21:47:37 +0100 | |
commit | ec2fd6e5c0217ae58a03eca1e83d85f02c739643 (patch) | |
tree | ff2a84f28a9ea88f698d5099e430e665f801d1f7 /sway/tree | |
parent | Update output containers on output layout change (diff) | |
download | sway-ec2fd6e5c0217ae58a03eca1e83d85f02c739643.tar.gz sway-ec2fd6e5c0217ae58a03eca1e83d85f02c739643.tar.zst sway-ec2fd6e5c0217ae58a03eca1e83d85f02c739643.zip |
Handle output remove
Diffstat (limited to 'sway/tree')
-rw-r--r-- | sway/tree/layout.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sway/tree/layout.c b/sway/tree/layout.c index 65382231..4bcf0e2f 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c | |||
@@ -23,10 +23,16 @@ static void output_layout_change_notify(struct wl_listener *listener, void *data | |||
23 | 23 | ||
24 | for (int i = 0 ; i < root_container.children->length; ++i) { | 24 | for (int i = 0 ; i < root_container.children->length; ++i) { |
25 | swayc_t *output_container = root_container.children->items[i]; | 25 | swayc_t *output_container = root_container.children->items[i]; |
26 | if (output_container->type != C_OUTPUT) { | ||
27 | continue; | ||
28 | } | ||
26 | struct sway_output *output = output_container->sway_output; | 29 | struct sway_output *output = output_container->sway_output; |
27 | 30 | ||
28 | struct wlr_box *output_box = wlr_output_layout_get_box( | 31 | struct wlr_box *output_box = wlr_output_layout_get_box( |
29 | root_container.sway_root->output_layout, output->wlr_output); | 32 | root_container.sway_root->output_layout, output->wlr_output); |
33 | if (!output_box) { | ||
34 | continue; | ||
35 | } | ||
30 | output_container->x = output_box->x; | 36 | output_container->x = output_box->x; |
31 | output_container->y = output_box->y; | 37 | output_container->y = output_box->y; |
32 | output_container->width = output_box->width; | 38 | output_container->width = output_box->width; |