diff options
author | 2017-12-13 21:47:37 +0100 | |
---|---|---|
committer | 2017-12-13 21:47:37 +0100 | |
commit | ec2fd6e5c0217ae58a03eca1e83d85f02c739643 (patch) | |
tree | ff2a84f28a9ea88f698d5099e430e665f801d1f7 /sway/desktop | |
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/desktop')
-rw-r--r-- | sway/desktop/output.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 2177ad74..ad843b31 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -123,5 +123,19 @@ void output_remove_notify(struct wl_listener *listener, void *data) { | |||
123 | struct sway_server *server = wl_container_of(listener, server, output_remove); | 123 | struct sway_server *server = wl_container_of(listener, server, output_remove); |
124 | struct wlr_output *wlr_output = data; | 124 | struct wlr_output *wlr_output = data; |
125 | sway_log(L_DEBUG, "Output %p %s removed", wlr_output, wlr_output->name); | 125 | sway_log(L_DEBUG, "Output %p %s removed", wlr_output, wlr_output->name); |
126 | // TODO | 126 | |
127 | swayc_t *output_container = NULL; | ||
128 | for (int i = 0 ; i < root_container.children->length; ++i) { | ||
129 | swayc_t *child = root_container.children->items[i]; | ||
130 | if (child->type == C_OUTPUT && | ||
131 | child->sway_output->wlr_output == wlr_output) { | ||
132 | output_container = child; | ||
133 | break; | ||
134 | } | ||
135 | } | ||
136 | if (!output_container) { | ||
137 | return; | ||
138 | } | ||
139 | |||
140 | destroy_output(output_container); | ||
127 | } | 141 | } |