diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-03-29 12:19:20 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-03-29 22:11:08 -0400 |
commit | a76829f3756d3df22fe46e6688374497de29c2e1 (patch) | |
tree | 2dc57796bf9975dacd3de8913cfe97d0c8fa981d /sway/desktop | |
parent | Respect user bar height preference (diff) | |
download | sway-a76829f3756d3df22fe46e6688374497de29c2e1.tar.gz sway-a76829f3756d3df22fe46e6688374497de29c2e1.tar.zst sway-a76829f3756d3df22fe46e6688374497de29c2e1.zip |
Some layer shell fixes
Based on the corresponding rootston changes
Diffstat (limited to 'sway/desktop')
-rw-r--r-- | sway/desktop/layer_shell.c | 22 | ||||
-rw-r--r-- | sway/desktop/output.c | 8 |
2 files changed, 8 insertions, 22 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c index bd62f84a..31679fb2 100644 --- a/sway/desktop/layer_shell.c +++ b/sway/desktop/layer_shell.c | |||
@@ -193,22 +193,10 @@ static void handle_output_destroy(struct wl_listener *listener, void *data) { | |||
193 | struct sway_layer_surface *sway_layer = | 193 | struct sway_layer_surface *sway_layer = |
194 | wl_container_of(listener, sway_layer, output_destroy); | 194 | wl_container_of(listener, sway_layer, output_destroy); |
195 | wl_list_remove(&sway_layer->output_destroy.link); | 195 | wl_list_remove(&sway_layer->output_destroy.link); |
196 | wl_list_remove(&sway_layer->output_mode.link); | ||
197 | wl_list_remove(&sway_layer->output_transform.link); | ||
198 | sway_layer->layer_surface->output = NULL; | 196 | sway_layer->layer_surface->output = NULL; |
199 | wlr_layer_surface_close(sway_layer->layer_surface); | 197 | wlr_layer_surface_close(sway_layer->layer_surface); |
200 | } | 198 | } |
201 | 199 | ||
202 | static void handle_output_mode(struct wl_listener *listener, void *data) { | ||
203 | struct wlr_output *output = data; | ||
204 | arrange_layers((struct sway_output *)output->data); | ||
205 | } | ||
206 | |||
207 | static void handle_output_transform(struct wl_listener *listener, void *data) { | ||
208 | struct wlr_output *output = data; | ||
209 | arrange_layers((struct sway_output *)output->data); | ||
210 | } | ||
211 | |||
212 | static void handle_surface_commit(struct wl_listener *listener, void *data) { | 200 | static void handle_surface_commit(struct wl_listener *listener, void *data) { |
213 | struct sway_layer_surface *layer = | 201 | struct sway_layer_surface *layer = |
214 | wl_container_of(listener, layer, surface_commit); | 202 | wl_container_of(listener, layer, surface_commit); |
@@ -243,8 +231,6 @@ static void handle_destroy(struct wl_listener *listener, void *data) { | |||
243 | wl_list_remove(&sway_layer->surface_commit.link); | 231 | wl_list_remove(&sway_layer->surface_commit.link); |
244 | if (sway_layer->layer_surface->output != NULL) { | 232 | if (sway_layer->layer_surface->output != NULL) { |
245 | wl_list_remove(&sway_layer->output_destroy.link); | 233 | wl_list_remove(&sway_layer->output_destroy.link); |
246 | wl_list_remove(&sway_layer->output_mode.link); | ||
247 | wl_list_remove(&sway_layer->output_transform.link); | ||
248 | } | 234 | } |
249 | struct sway_output *output = sway_layer->layer_surface->output->data; | 235 | struct sway_output *output = sway_layer->layer_surface->output->data; |
250 | arrange_layers(output); | 236 | arrange_layers(output); |
@@ -289,14 +275,6 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) { | |||
289 | wl_signal_add(&layer_surface->output->events.destroy, | 275 | wl_signal_add(&layer_surface->output->events.destroy, |
290 | &sway_layer->output_destroy); | 276 | &sway_layer->output_destroy); |
291 | 277 | ||
292 | sway_layer->output_mode.notify = handle_output_mode; | ||
293 | wl_signal_add(&layer_surface->output->events.mode, | ||
294 | &sway_layer->output_mode); | ||
295 | |||
296 | sway_layer->output_transform.notify = handle_output_transform; | ||
297 | wl_signal_add(&layer_surface->output->events.transform, | ||
298 | &sway_layer->output_transform); | ||
299 | |||
300 | sway_layer->destroy.notify = handle_destroy; | 278 | sway_layer->destroy.notify = handle_destroy; |
301 | wl_signal_add(&layer_surface->events.destroy, &sway_layer->destroy); | 279 | wl_signal_add(&layer_surface->events.destroy, &sway_layer->destroy); |
302 | sway_layer->map.notify = handle_map; | 280 | sway_layer->map.notify = handle_map; |
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index b8253ace..30b23a18 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -268,6 +268,12 @@ static void handle_output_mode(struct wl_listener *listener, void *data) { | |||
268 | arrange_windows(output->swayc, -1, -1); | 268 | arrange_windows(output->swayc, -1, -1); |
269 | } | 269 | } |
270 | 270 | ||
271 | static void handle_output_transform(struct wl_listener *listener, void *data) { | ||
272 | struct sway_output *output = wl_container_of(listener, output, transform); | ||
273 | arrange_layers(output); | ||
274 | arrange_windows(output->swayc, -1, -1); | ||
275 | } | ||
276 | |||
271 | void handle_new_output(struct wl_listener *listener, void *data) { | 277 | void handle_new_output(struct wl_listener *listener, void *data) { |
272 | struct sway_server *server = wl_container_of(listener, server, new_output); | 278 | struct sway_server *server = wl_container_of(listener, server, new_output); |
273 | struct wlr_output *wlr_output = data; | 279 | struct wlr_output *wlr_output = data; |
@@ -306,6 +312,8 @@ void handle_new_output(struct wl_listener *listener, void *data) { | |||
306 | output->destroy.notify = handle_output_destroy; | 312 | output->destroy.notify = handle_output_destroy; |
307 | wl_signal_add(&wlr_output->events.mode, &output->mode); | 313 | wl_signal_add(&wlr_output->events.mode, &output->mode); |
308 | output->mode.notify = handle_output_mode; | 314 | output->mode.notify = handle_output_mode; |
315 | wl_signal_add(&wlr_output->events.transform, &output->transform); | ||
316 | output->transform.notify = handle_output_transform; | ||
309 | 317 | ||
310 | arrange_layers(output); | 318 | arrange_layers(output); |
311 | arrange_windows(&root_container, -1, -1); | 319 | arrange_windows(&root_container, -1, -1); |