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 95a84d12..617350d9 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c | |||
@@ -19,10 +19,14 @@ | |||
19 | 19 | ||
20 | struct sway_container root_container; | 20 | struct sway_container root_container; |
21 | 21 | ||
22 | static void output_layout_change_notify(struct wl_listener *listener, | 22 | static void output_layout_handle_change(struct wl_listener *listener, |
23 | void *data) { | 23 | void *data) { |
24 | struct wlr_box *layout_box = wlr_output_layout_get_box( | 24 | struct wlr_output_layout *output_layout = |
25 | root_container.sway_root->output_layout, NULL); | 25 | root_container.sway_root->output_layout; |
26 | const struct wlr_box *layout_box = | ||
27 | wlr_output_layout_get_box(output_layout, NULL); | ||
28 | root_container.x = layout_box->x; | ||
29 | root_container.y = layout_box->y; | ||
26 | root_container.width = layout_box->width; | 30 | root_container.width = layout_box->width; |
27 | root_container.height = layout_box->height; | 31 | root_container.height = layout_box->height; |
28 | 32 | ||
@@ -34,8 +38,8 @@ static void output_layout_change_notify(struct wl_listener *listener, | |||
34 | } | 38 | } |
35 | struct sway_output *output = output_container->sway_output; | 39 | struct sway_output *output = output_container->sway_output; |
36 | 40 | ||
37 | struct wlr_box *output_box = wlr_output_layout_get_box( | 41 | const struct wlr_box *output_box = |
38 | root_container.sway_root->output_layout, output->wlr_output); | 42 | wlr_output_layout_get_box(output_layout, output->wlr_output); |
39 | if (!output_box) { | 43 | if (!output_box) { |
40 | continue; | 44 | continue; |
41 | } | 45 | } |
@@ -62,7 +66,7 @@ void layout_init(void) { | |||
62 | wl_signal_init(&root_container.sway_root->events.new_container); | 66 | wl_signal_init(&root_container.sway_root->events.new_container); |
63 | 67 | ||
64 | root_container.sway_root->output_layout_change.notify = | 68 | root_container.sway_root->output_layout_change.notify = |
65 | output_layout_change_notify; | 69 | output_layout_handle_change; |
66 | wl_signal_add(&root_container.sway_root->output_layout->events.change, | 70 | wl_signal_add(&root_container.sway_root->output_layout->events.change, |
67 | &root_container.sway_root->output_layout_change); | 71 | &root_container.sway_root->output_layout_change); |
68 | } | 72 | } |