aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Luminarys <kizunanohikari@gmail.com>2015-08-17 14:22:49 -0500
committerLibravatar Luminarys <kizunanohikari@gmail.com>2015-08-17 14:22:49 -0500
commitb5f19f0fd3c4f10ecee0993c45fa057d21b98778 (patch)
treee6f64e840b80c50c49047e96a4abda1bcf2a927f
parentMerge pull request #56 from taiyu-len/master (diff)
downloadsway-b5f19f0fd3c4f10ecee0993c45fa057d21b98778.tar.gz
sway-b5f19f0fd3c4f10ecee0993c45fa057d21b98778.tar.zst
sway-b5f19f0fd3c4f10ecee0993c45fa057d21b98778.zip
View destroy handling clean up and clarifications
-rw-r--r--sway/handlers.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sway/handlers.c b/sway/handlers.c
index 5c673697..4cd7d490 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -137,8 +137,10 @@ static void handle_view_destroyed(wlc_handle handle) {
137 wlc_view_set_state(handle, WLC_BIT_ACTIVATED, true); 137 wlc_view_set_state(handle, WLC_BIT_ACTIVATED, true);
138 sway_log(L_DEBUG,"Unmanaged window of type %x was destroyed", type); 138 sway_log(L_DEBUG,"Unmanaged window of type %x was destroyed", type);
139 if (type & WLC_BIT_UNMANAGED) { 139 if (type & WLC_BIT_UNMANAGED) {
140 // We need to call focus_view() on focus_pointer because when unmanaged windows
141 // do not alter the focus structure of the container tree. This makes focus_pointer()
142 // think that it doesn't need to do anything, so we manually focus the result.
140 focus_view(focus_pointer()); 143 focus_view(focus_pointer());
141 arrange_windows(active_workspace, -1, -1);
142 return; 144 return;
143 } 145 }
144 146
@@ -147,11 +149,8 @@ static void handle_view_destroyed(wlc_handle handle) {
147 focus_view(focus_pointer()); 149 focus_view(focus_pointer());
148 return; 150 return;
149 } 151 }
150 if (type & WLC_BIT_POPUP) {
151 swayc_t *view = get_swayc_for_handle(handle, &root_container);
152 destroy_view(view);
153 }
154 } 152 }
153
155 swayc_t *view = get_swayc_for_handle(handle, &root_container); 154 swayc_t *view = get_swayc_for_handle(handle, &root_container);
156 swayc_t *parent; 155 swayc_t *parent;
157 swayc_t *focused = get_focused_container(&root_container); 156 swayc_t *focused = get_focused_container(&root_container);