mirror of
https://github.com/swaywm/sway.git
synced 2024-11-26 18:01:29 +00:00
parent
46e5aeac50
commit
5ecedc7199
|
@ -516,11 +516,11 @@ swayc_t *destroy_view(swayc_t *view) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
sway_log(L_DEBUG, "Destroying view '%p'", view);
|
sway_log(L_DEBUG, "Destroying view '%p'", view);
|
||||||
swayc_t *parent = view->parent;
|
|
||||||
free_swayc(view);
|
free_swayc(view);
|
||||||
|
|
||||||
// Destroy empty containers
|
// Destroy empty containers
|
||||||
if (parent->type == C_CONTAINER) {
|
swayc_t *parent = view->parent;
|
||||||
|
if (parent && parent->type == C_CONTAINER) {
|
||||||
return destroy_container(parent);
|
return destroy_container(parent);
|
||||||
}
|
}
|
||||||
return parent;
|
return parent;
|
||||||
|
|
|
@ -553,22 +553,24 @@ static void handle_view_destroyed(wlc_handle handle) {
|
||||||
bool fullscreen = swayc_is_fullscreen(view);
|
bool fullscreen = swayc_is_fullscreen(view);
|
||||||
remove_view_from_scratchpad(view);
|
remove_view_from_scratchpad(view);
|
||||||
swayc_t *parent = destroy_view(view);
|
swayc_t *parent = destroy_view(view);
|
||||||
if (fullscreen) {
|
if (parent) {
|
||||||
parent->fullscreen = NULL;
|
if (fullscreen) {
|
||||||
|
parent->fullscreen = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
ipc_event_window(parent, "close");
|
||||||
|
|
||||||
|
// Destroy empty workspaces
|
||||||
|
if (parent->type == C_WORKSPACE &&
|
||||||
|
parent->children->length == 0 &&
|
||||||
|
parent->floating->length == 0 &&
|
||||||
|
swayc_active_workspace() != parent &&
|
||||||
|
!parent->visible) {
|
||||||
|
parent = destroy_workspace(parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
arrange_windows(parent, -1, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
ipc_event_window(parent, "close");
|
|
||||||
|
|
||||||
// Destroy empty workspaces
|
|
||||||
if (parent->type == C_WORKSPACE &&
|
|
||||||
parent->children->length == 0 &&
|
|
||||||
parent->floating->length == 0 &&
|
|
||||||
swayc_active_workspace() != parent &&
|
|
||||||
!parent->visible) {
|
|
||||||
parent = destroy_workspace(parent);
|
|
||||||
}
|
|
||||||
|
|
||||||
arrange_windows(parent, -1, -1);
|
|
||||||
} else {
|
} else {
|
||||||
// Is it unmanaged?
|
// Is it unmanaged?
|
||||||
int i;
|
int i;
|
||||||
|
@ -584,6 +586,15 @@ static void handle_view_destroyed(wlc_handle handle) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Is it in the scratchpad?
|
||||||
|
for (i = 0; i < scratchpad->length; ++i) {
|
||||||
|
swayc_t *item = scratchpad->items[i];
|
||||||
|
if (item->handle == handle) {
|
||||||
|
list_del(scratchpad, i);
|
||||||
|
destroy_view(item);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
set_focused_container(get_focused_view(&root_container));
|
set_focused_container(get_focused_view(&root_container));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue