diff options
author | 2015-12-16 19:20:34 -0500 | |
---|---|---|
committer | 2015-12-16 19:20:34 -0500 | |
commit | f6da4dda4b9598eab16d4d7d77a06693fa6df9c3 (patch) | |
tree | 20ef4c5270639ac0cf972ab75a497b9e461dccf2 /sway/handlers.c | |
parent | Merge pull request #340 from mikkeloscar/seperator-separator (diff) | |
download | sway-f6da4dda4b9598eab16d4d7d77a06693fa6df9c3.tar.gz sway-f6da4dda4b9598eab16d4d7d77a06693fa6df9c3.tar.zst sway-f6da4dda4b9598eab16d4d7d77a06693fa6df9c3.zip |
Bring unmanaged windows to front on output arrange
Fixes #312
Diffstat (limited to 'sway/handlers.c')
-rw-r--r-- | sway/handlers.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sway/handlers.c b/sway/handlers.c index dea15acc..136ef577 100644 --- a/sway/handlers.c +++ b/sway/handlers.c | |||
@@ -220,6 +220,12 @@ static bool handle_view_created(wlc_handle handle) { | |||
220 | // refocus in-between command lists | 220 | // refocus in-between command lists |
221 | set_focused_container(newview); | 221 | set_focused_container(newview); |
222 | } | 222 | } |
223 | } else { | ||
224 | swayc_t *output = swayc_parent_by_type(focused, C_OUTPUT); | ||
225 | wlc_handle *h = malloc(sizeof(wlc_handle)); | ||
226 | *h = handle; | ||
227 | sway_log(L_DEBUG, "Adding unmanaged window %p to %p", h, output->unmanaged); | ||
228 | list_add(output->unmanaged, h); | ||
223 | } | 229 | } |
224 | return true; | 230 | return true; |
225 | } | 231 | } |
@@ -249,6 +255,21 @@ static void handle_view_destroyed(wlc_handle handle) { | |||
249 | swayc_t *parent = destroy_view(view); | 255 | swayc_t *parent = destroy_view(view); |
250 | remove_view_from_scratchpad(view); | 256 | remove_view_from_scratchpad(view); |
251 | arrange_windows(parent, -1, -1); | 257 | arrange_windows(parent, -1, -1); |
258 | } else { | ||
259 | // Is it unmanaged? | ||
260 | int i; | ||
261 | for (i = 0; i < root_container.children->length; ++i) { | ||
262 | swayc_t *output = root_container.children->items[i]; | ||
263 | int j; | ||
264 | for (j = 0; j < output->unmanaged->length; ++j) { | ||
265 | wlc_handle *_handle = output->unmanaged->items[j]; | ||
266 | if (*_handle == handle) { | ||
267 | list_del(output->unmanaged, j); | ||
268 | free(_handle); | ||
269 | break; | ||
270 | } | ||
271 | } | ||
272 | } | ||
252 | } | 273 | } |
253 | set_focused_container(get_focused_view(&root_container)); | 274 | set_focused_container(get_focused_view(&root_container)); |
254 | } | 275 | } |