diff options
author | taiyu <taiyu.len@gmail.com> | 2015-08-30 16:28:21 -0700 |
---|---|---|
committer | taiyu <taiyu.len@gmail.com> | 2015-08-30 16:28:21 -0700 |
commit | 7fbb8b785e229341171470228fea22caac3ee896 (patch) | |
tree | c07e46ca86e55a293586f01ef4b664e4c9dd1dea /sway | |
parent | f787fac8fc1ecc8245ccba848627fbca5a5b63a5 (diff) |
#154 destroy view handler properly destroys views
Diffstat (limited to 'sway')
-rw-r--r-- | sway/handlers.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sway/handlers.c b/sway/handlers.c index 4c21c6b9..b12be9f7 100644 --- a/sway/handlers.c +++ b/sway/handlers.c @@ -230,16 +230,12 @@ static void handle_view_destroyed(wlc_handle handle) { sway_log(L_DEBUG, "Destroying window %lu", handle); swayc_t *view = swayc_by_handle(handle); + // destroy views by type switch (wlc_view_get_type(handle)) { // regular view created regularly case 0: case WLC_BIT_MODAL: case WLC_BIT_POPUP: - if (view) { - swayc_t *parent = destroy_view(view); - remove_view_from_scratchpad(view); - arrange_windows(parent, -1, -1); - } break; // DMENU has this flag, and takes view_focus, but other things with this // flag dont @@ -251,6 +247,11 @@ static void handle_view_destroyed(wlc_handle handle) { break; } + if (view) { + swayc_t *parent = destroy_view(view); + remove_view_from_scratchpad(view); + arrange_windows(parent, -1, -1); + } set_focused_container(get_focused_view(&root_container)); } |