diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-10-17 16:56:06 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-17 16:56:06 -0400 |
commit | 4ded0914910abacf414114e6d68609d5f1b7a552 (patch) | |
tree | 7032033e58b140df89d86aca03c2f2b0373d4f5c /sway | |
parent | a996ee485d7e6d993e6636f3235b8c2a79d7cc33 (diff) | |
parent | 22906f7fce550f57528df6b33049b9dc74f87abc (diff) |
Merge pull request #1412 from Hummer12007/rcfix
handlers: preserve parent pointer value
Diffstat (limited to 'sway')
-rw-r--r-- | sway/handlers.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sway/handlers.c b/sway/handlers.c index 6ccf2b11..33e75d6b 100644 --- a/sway/handlers.c +++ b/sway/handlers.c @@ -552,7 +552,7 @@ static void handle_view_destroyed(wlc_handle handle) { if (view) { bool fullscreen = swayc_is_fullscreen(view); remove_view_from_scratchpad(view); - swayc_t *parent = destroy_view(view); + swayc_t *parent = destroy_view(view), *iter = NULL; if (parent) { ipc_event_window(parent, "close"); @@ -566,17 +566,18 @@ static void handle_view_destroyed(wlc_handle handle) { } if (fullscreen) { - while (parent) { - if (parent->fullscreen) { - parent->fullscreen = NULL; + iter = parent; + while (iter) { + if (iter->fullscreen) { + iter->fullscreen = NULL; break; } - parent = parent->parent; + iter = iter->parent; } } - arrange_windows(parent, -1, -1); + arrange_windows(iter ? iter : parent, -1, -1); } } else { // Is it unmanaged? |