diff options
author | Drew DeVault <sir@cmpwn.com> | 2016-07-21 15:57:00 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-21 15:57:00 -0400 |
commit | f181bf9c542ccb0478f653bbab76f60ac198a800 (patch) | |
tree | 3e36293102f4fae4fac864fced569de8717d73ea | |
parent | Merge pull request #776 from Hummer12007/window-events (diff) | |
parent | Arrange backgrounds only when required (diff) | |
download | sway-f181bf9c542ccb0478f653bbab76f60ac198a800.tar.gz sway-f181bf9c542ccb0478f653bbab76f60ac198a800.tar.zst sway-f181bf9c542ccb0478f653bbab76f60ac198a800.zip |
Merge pull request #777 from Hummer12007/bg-arng
Arrange backgrounds only when required
-rw-r--r-- | include/layout.h | 1 | ||||
-rw-r--r-- | sway/focus.c | 1 | ||||
-rw-r--r-- | sway/layout.c | 5 | ||||
-rw-r--r-- | sway/workspace.c | 1 |
4 files changed, 7 insertions, 1 deletions
diff --git a/include/layout.h b/include/layout.h index c05e9e69..b982365c 100644 --- a/include/layout.h +++ b/include/layout.h | |||
@@ -59,6 +59,7 @@ void move_workspace_to(swayc_t* workspace, swayc_t* destination); | |||
59 | void update_layout_geometry(swayc_t *parent, enum swayc_layouts prev_layout); | 59 | void update_layout_geometry(swayc_t *parent, enum swayc_layouts prev_layout); |
60 | void update_geometry(swayc_t *view); | 60 | void update_geometry(swayc_t *view); |
61 | void arrange_windows(swayc_t *container, double width, double height); | 61 | void arrange_windows(swayc_t *container, double width, double height); |
62 | void arrange_backgrounds(void); | ||
62 | 63 | ||
63 | swayc_t *get_focused_container(swayc_t *parent); | 64 | swayc_t *get_focused_container(swayc_t *parent); |
64 | swayc_t *get_swayc_in_direction(swayc_t *container, enum movement_direction dir); | 65 | swayc_t *get_swayc_in_direction(swayc_t *container, enum movement_direction dir); |
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) { | |||
158 | // rearrange if parent container is tabbed/stacked | 158 | // rearrange if parent container is tabbed/stacked |
159 | swayc_t *parent = swayc_tabbed_stacked_ancestor(p); | 159 | swayc_t *parent = swayc_tabbed_stacked_ancestor(p); |
160 | if (parent != NULL) { | 160 | if (parent != NULL) { |
161 | arrange_backgrounds(); | ||
161 | arrange_windows(parent, -1, -1); | 162 | arrange_windows(parent, -1, -1); |
162 | } | 163 | } |
163 | } else if (p->type == C_WORKSPACE) { | 164 | } 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) { | |||
961 | update_visibility(container); | 961 | update_visibility(container); |
962 | arrange_windows_r(container, width, height); | 962 | arrange_windows_r(container, width, height); |
963 | layout_log(&root_container, 0); | 963 | layout_log(&root_container, 0); |
964 | } | ||
964 | 965 | ||
966 | void arrange_backgrounds(void) { | ||
967 | struct background_config *bg; | ||
965 | for (int i = 0; i < desktop_shell.backgrounds->length; ++i) { | 968 | for (int i = 0; i < desktop_shell.backgrounds->length; ++i) { |
966 | struct background_config *bg = desktop_shell.backgrounds->items[i]; | 969 | bg = desktop_shell.backgrounds->items[i]; |
967 | wlc_view_send_to_back(bg->handle); | 970 | wlc_view_send_to_back(bg->handle); |
968 | } | 971 | } |
969 | } | 972 | } |
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) { | |||
308 | return false; | 308 | return false; |
309 | } | 309 | } |
310 | swayc_t *output = swayc_parent_by_type(workspace, C_OUTPUT); | 310 | swayc_t *output = swayc_parent_by_type(workspace, C_OUTPUT); |
311 | arrange_backgrounds(); | ||
311 | arrange_windows(output, -1, -1); | 312 | arrange_windows(output, -1, -1); |
312 | return true; | 313 | return true; |
313 | } | 314 | } |