diff options
-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) { | |||
230 | sway_log(L_DEBUG, "Destroying window %lu", handle); | 230 | sway_log(L_DEBUG, "Destroying window %lu", handle); |
231 | swayc_t *view = swayc_by_handle(handle); | 231 | swayc_t *view = swayc_by_handle(handle); |
232 | 232 | ||
233 | // destroy views by type | ||
233 | switch (wlc_view_get_type(handle)) { | 234 | switch (wlc_view_get_type(handle)) { |
234 | // regular view created regularly | 235 | // regular view created regularly |
235 | case 0: | 236 | case 0: |
236 | case WLC_BIT_MODAL: | 237 | case WLC_BIT_MODAL: |
237 | case WLC_BIT_POPUP: | 238 | case WLC_BIT_POPUP: |
238 | if (view) { | ||
239 | swayc_t *parent = destroy_view(view); | ||
240 | remove_view_from_scratchpad(view); | ||
241 | arrange_windows(parent, -1, -1); | ||
242 | } | ||
243 | break; | 239 | break; |
244 | // DMENU has this flag, and takes view_focus, but other things with this | 240 | // DMENU has this flag, and takes view_focus, but other things with this |
245 | // flag dont | 241 | // flag dont |
@@ -251,6 +247,11 @@ static void handle_view_destroyed(wlc_handle handle) { | |||
251 | break; | 247 | break; |
252 | } | 248 | } |
253 | 249 | ||
250 | if (view) { | ||
251 | swayc_t *parent = destroy_view(view); | ||
252 | remove_view_from_scratchpad(view); | ||
253 | arrange_windows(parent, -1, -1); | ||
254 | } | ||
254 | set_focused_container(get_focused_view(&root_container)); | 255 | set_focused_container(get_focused_view(&root_container)); |
255 | } | 256 | } |
256 | 257 | ||