diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-04-22 19:27:34 +0200 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-04-23 11:15:07 +0200 |
commit | 420a669f214a948bb4e47de1cca7ea02014b5251 (patch) | |
tree | 9fab4e3f23b68a6b6b40bc89c8e22ac2615362ae | |
parent | Merge pull request #1847 from RyanDwyer/rename-workspace (diff) | |
download | sway-420a669f214a948bb4e47de1cca7ea02014b5251.tar.gz sway-420a669f214a948bb4e47de1cca7ea02014b5251.tar.zst sway-420a669f214a948bb4e47de1cca7ea02014b5251.zip |
Updates per swaywm/wlroots#887
-rw-r--r-- | sway/desktop/layer_shell.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c index f841e5f1..f9a1a8bd 100644 --- a/sway/desktop/layer_shell.c +++ b/sway/desktop/layer_shell.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include "sway/output.h" | 13 | #include "sway/output.h" |
14 | #include "sway/server.h" | 14 | #include "sway/server.h" |
15 | #include "sway/tree/layout.h" | 15 | #include "sway/tree/layout.h" |
16 | #include "log.h" | ||
16 | 17 | ||
17 | static void apply_exclusive(struct wlr_box *usable_area, | 18 | static void apply_exclusive(struct wlr_box *usable_area, |
18 | uint32_t anchor, int32_t exclusive, | 19 | uint32_t anchor, int32_t exclusive, |
@@ -316,6 +317,27 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) { | |||
316 | return; | 317 | return; |
317 | } | 318 | } |
318 | 319 | ||
320 | if (!layer_surface->output) { | ||
321 | // Assign last active output | ||
322 | struct sway_container *output = NULL; | ||
323 | struct sway_seat *seat = input_manager_get_default_seat(input_manager); | ||
324 | if (seat) { | ||
325 | output = seat_get_focus_inactive(seat, &root_container); | ||
326 | } | ||
327 | if (!output) { | ||
328 | if (!sway_assert(root_container.children->length, | ||
329 | "cannot auto-assign output for layer")) { | ||
330 | wlr_layer_surface_close(layer_surface); | ||
331 | return; | ||
332 | } | ||
333 | output = root_container.children->items[0]; | ||
334 | } | ||
335 | if (output->type != C_OUTPUT) { | ||
336 | output = container_parent(output, C_OUTPUT); | ||
337 | } | ||
338 | layer_surface->output = output->sway_output->wlr_output; | ||
339 | } | ||
340 | |||
319 | sway_layer->surface_commit.notify = handle_surface_commit; | 341 | sway_layer->surface_commit.notify = handle_surface_commit; |
320 | wl_signal_add(&layer_surface->surface->events.commit, | 342 | wl_signal_add(&layer_surface->surface->events.commit, |
321 | &sway_layer->surface_commit); | 343 | &sway_layer->surface_commit); |