diff options
-rw-r--r-- | include/sway/output.h | 2 | ||||
-rw-r--r-- | include/sway/server.h | 1 | ||||
-rw-r--r-- | sway/desktop/output.c | 7 | ||||
-rw-r--r-- | sway/server.c | 3 |
4 files changed, 13 insertions, 0 deletions
diff --git a/include/sway/output.h b/include/sway/output.h index 3d430ea2..a5a2f29e 100644 --- a/include/sway/output.h +++ b/include/sway/output.h | |||
@@ -154,6 +154,8 @@ void scale_box(struct wlr_box *box, float scale); | |||
154 | 154 | ||
155 | enum wlr_direction opposite_direction(enum wlr_direction d); | 155 | enum wlr_direction opposite_direction(enum wlr_direction d); |
156 | 156 | ||
157 | void handle_output_layout_change(struct wl_listener *listener, void *data); | ||
158 | |||
157 | void handle_output_manager_apply(struct wl_listener *listener, void *data); | 159 | void handle_output_manager_apply(struct wl_listener *listener, void *data); |
158 | 160 | ||
159 | void handle_output_manager_test(struct wl_listener *listener, void *data); | 161 | void handle_output_manager_test(struct wl_listener *listener, void *data); |
diff --git a/include/sway/server.h b/include/sway/server.h index fd613bb6..21661685 100644 --- a/include/sway/server.h +++ b/include/sway/server.h | |||
@@ -34,6 +34,7 @@ struct sway_server { | |||
34 | struct sway_input_manager *input; | 34 | struct sway_input_manager *input; |
35 | 35 | ||
36 | struct wl_listener new_output; | 36 | struct wl_listener new_output; |
37 | struct wl_listener output_layout_change; | ||
37 | 38 | ||
38 | struct wlr_idle *idle; | 39 | struct wlr_idle *idle; |
39 | struct sway_idle_inhibit_manager_v1 *idle_inhibit_manager_v1; | 40 | struct sway_idle_inhibit_manager_v1 *idle_inhibit_manager_v1; |
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index fe50759a..22ced14e 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -688,6 +688,13 @@ void handle_new_output(struct wl_listener *listener, void *data) { | |||
688 | update_output_manager_config(server); | 688 | update_output_manager_config(server); |
689 | } | 689 | } |
690 | 690 | ||
691 | void handle_output_layout_change(struct wl_listener *listener, | ||
692 | void *data) { | ||
693 | struct sway_server *server = | ||
694 | wl_container_of(listener, server, output_layout_change); | ||
695 | update_output_manager_config(server); | ||
696 | } | ||
697 | |||
691 | void handle_output_manager_apply(struct wl_listener *listener, void *data) { | 698 | void handle_output_manager_apply(struct wl_listener *listener, void *data) { |
692 | struct sway_server *server = | 699 | struct sway_server *server = |
693 | wl_container_of(listener, server, output_manager_apply); | 700 | wl_container_of(listener, server, output_manager_apply); |
diff --git a/sway/server.c b/sway/server.c index b50e3ccc..4f46a065 100644 --- a/sway/server.c +++ b/sway/server.c | |||
@@ -66,6 +66,9 @@ bool server_init(struct sway_server *server) { | |||
66 | 66 | ||
67 | server->new_output.notify = handle_new_output; | 67 | server->new_output.notify = handle_new_output; |
68 | wl_signal_add(&server->backend->events.new_output, &server->new_output); | 68 | wl_signal_add(&server->backend->events.new_output, &server->new_output); |
69 | server->output_layout_change.notify = handle_output_layout_change; | ||
70 | wl_signal_add(&root->output_layout->events.change, | ||
71 | &server->output_layout_change); | ||
69 | 72 | ||
70 | wlr_xdg_output_manager_v1_create(server->wl_display, root->output_layout); | 73 | wlr_xdg_output_manager_v1_create(server->wl_display, root->output_layout); |
71 | 74 | ||