diff options
author | Mykyta Holubakha <hilobakho@gmail.com> | 2016-07-21 22:47:35 +0300 |
---|---|---|
committer | Mykyta Holubakha <hilobakho@gmail.com> | 2016-07-21 22:47:35 +0300 |
commit | a2bc6f3bfd35c9785b8b3bb1a788587f298edef6 (patch) | |
tree | 3e36293102f4fae4fac864fced569de8717d73ea /sway | |
parent | 464239f7ac11d32a6f10b8517b8410a2eb9b493a (diff) |
Arrange backgrounds only when required
Diffstat (limited to 'sway')
-rw-r--r-- | sway/focus.c | 1 | ||||
-rw-r--r-- | sway/layout.c | 5 | ||||
-rw-r--r-- | sway/workspace.c | 1 |
3 files changed, 6 insertions, 1 deletions
diff --git a/sway/focus.c b/sway/focus.c index 97fa4b98..9974ba6a 100644 --- a/sway/focus.c +++ b/sway/focus.c @@ -158,6 +158,7 @@ bool set_focused_container(swayc_t *c) { // rearrange if parent container is tabbed/stacked swayc_t *parent = swayc_tabbed_stacked_ancestor(p); if (parent != NULL) { + arrange_backgrounds(); arrange_windows(parent, -1, -1); } } else if (p->type == C_WORKSPACE) { diff --git a/sway/layout.c b/sway/layout.c index d32b4139..faa108a1 100644 --- a/sway/layout.c +++ b/sway/layout.c @@ -961,9 +961,12 @@ void arrange_windows(swayc_t *container, double width, double height) { update_visibility(container); arrange_windows_r(container, width, height); layout_log(&root_container, 0); +} +void arrange_backgrounds(void) { + struct background_config *bg; for (int i = 0; i < desktop_shell.backgrounds->length; ++i) { - struct background_config *bg = desktop_shell.backgrounds->items[i]; + bg = desktop_shell.backgrounds->items[i]; wlc_view_send_to_back(bg->handle); } } diff --git a/sway/workspace.c b/sway/workspace.c index 913a412c..9c3e69a9 100644 --- a/sway/workspace.c +++ b/sway/workspace.c @@ -308,6 +308,7 @@ bool workspace_switch(swayc_t *workspace) { return false; } swayc_t *output = swayc_parent_by_type(workspace, C_OUTPUT); + arrange_backgrounds(); arrange_windows(output, -1, -1); return true; } |