aboutsummaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar taiyu <taiyu.len@gmail.com>2015-08-30 16:28:21 -0700
committerLibravatar taiyu <taiyu.len@gmail.com>2015-08-30 16:28:21 -0700
commit7fbb8b785e229341171470228fea22caac3ee896 (patch)
treec07e46ca86e55a293586f01ef4b664e4c9dd1dea /sway
parent#153 add "ctrl" and "alt" to modifiers struct (diff)
downloadsway-7fbb8b785e229341171470228fea22caac3ee896.tar.gz
sway-7fbb8b785e229341171470228fea22caac3ee896.tar.zst
sway-7fbb8b785e229341171470228fea22caac3ee896.zip
#154 destroy view handler properly destroys views
Diffstat (limited to 'sway')
-rw-r--r--sway/handlers.c11
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