diff options
Diffstat (limited to 'sway/tree/layout.c')
-rw-r--r-- | sway/tree/layout.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sway/tree/layout.c b/sway/tree/layout.c index a46359bd..5abdbc32 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c | |||
@@ -18,10 +18,14 @@ | |||
18 | 18 | ||
19 | struct sway_container root_container; | 19 | struct sway_container root_container; |
20 | 20 | ||
21 | static void output_layout_change_notify(struct wl_listener *listener, | 21 | static void output_layout_handle_change(struct wl_listener *listener, |
22 | void *data) { | 22 | void *data) { |
23 | struct wlr_box *layout_box = wlr_output_layout_get_box( | 23 | struct wlr_output_layout *output_layout = |
24 | root_container.sway_root->output_layout, NULL); | 24 | root_container.sway_root->output_layout; |
25 | const struct wlr_box *layout_box = | ||
26 | wlr_output_layout_get_box(output_layout, NULL); | ||
27 | root_container.x = layout_box->x; | ||
28 | root_container.y = layout_box->y; | ||
25 | root_container.width = layout_box->width; | 29 | root_container.width = layout_box->width; |
26 | root_container.height = layout_box->height; | 30 | root_container.height = layout_box->height; |
27 | 31 | ||
@@ -33,8 +37,8 @@ static void output_layout_change_notify(struct wl_listener *listener, | |||
33 | } | 37 | } |
34 | struct sway_output *output = output_container->sway_output; | 38 | struct sway_output *output = output_container->sway_output; |
35 | 39 | ||
36 | struct wlr_box *output_box = wlr_output_layout_get_box( | 40 | const struct wlr_box *output_box = |
37 | root_container.sway_root->output_layout, output->wlr_output); | 41 | wlr_output_layout_get_box(output_layout, output->wlr_output); |
38 | if (!output_box) { | 42 | if (!output_box) { |
39 | continue; | 43 | continue; |
40 | } | 44 | } |
@@ -74,7 +78,7 @@ void layout_init(void) { | |||
74 | wl_signal_init(&root_container.sway_root->events.new_container); | 78 | wl_signal_init(&root_container.sway_root->events.new_container); |
75 | 79 | ||
76 | root_container.sway_root->output_layout_change.notify = | 80 | root_container.sway_root->output_layout_change.notify = |
77 | output_layout_change_notify; | 81 | output_layout_handle_change; |
78 | wl_signal_add(&root_container.sway_root->output_layout->events.change, | 82 | wl_signal_add(&root_container.sway_root->output_layout->events.change, |
79 | &root_container.sway_root->output_layout_change); | 83 | &root_container.sway_root->output_layout_change); |
80 | } | 84 | } |