aboutsummaryrefslogtreecommitdiffstats
path: root/sway/handlers.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/handlers.c')
-rw-r--r--sway/handlers.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/sway/handlers.c b/sway/handlers.c
index dea15acc..136ef577 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -220,6 +220,12 @@ static bool handle_view_created(wlc_handle handle) {
220 // refocus in-between command lists 220 // refocus in-between command lists
221 set_focused_container(newview); 221 set_focused_container(newview);
222 } 222 }
223 } else {
224 swayc_t *output = swayc_parent_by_type(focused, C_OUTPUT);
225 wlc_handle *h = malloc(sizeof(wlc_handle));
226 *h = handle;
227 sway_log(L_DEBUG, "Adding unmanaged window %p to %p", h, output->unmanaged);
228 list_add(output->unmanaged, h);
223 } 229 }
224 return true; 230 return true;
225} 231}
@@ -249,6 +255,21 @@ static void handle_view_destroyed(wlc_handle handle) {
249 swayc_t *parent = destroy_view(view); 255 swayc_t *parent = destroy_view(view);
250 remove_view_from_scratchpad(view); 256 remove_view_from_scratchpad(view);
251 arrange_windows(parent, -1, -1); 257 arrange_windows(parent, -1, -1);
258 } else {
259 // Is it unmanaged?
260 int i;
261 for (i = 0; i < root_container.children->length; ++i) {
262 swayc_t *output = root_container.children->items[i];
263 int j;
264 for (j = 0; j < output->unmanaged->length; ++j) {
265 wlc_handle *_handle = output->unmanaged->items[j];
266 if (*_handle == handle) {
267 list_del(output->unmanaged, j);
268 free(_handle);
269 break;
270 }
271 }
272 }
252 } 273 }
253 set_focused_container(get_focused_view(&root_container)); 274 set_focused_container(get_focused_view(&root_container));
254} 275}