mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-04-02 07:15:55 -04:00
opt: cleanup layer scene node when cleanupmon
This commit is contained in:
parent
c2ed0a48d8
commit
4ed671d30a
3 changed files with 26 additions and 3 deletions
|
|
@ -521,7 +521,7 @@ void client_animation_next_tick(Client *c) {
|
|||
|
||||
void init_fadeout_client(Client *c) {
|
||||
|
||||
if (!c->mon || client_is_unmanaged(c))
|
||||
if (!c->mon || client_is_unmanaged(c) || c->mon->iscleanuping)
|
||||
return;
|
||||
|
||||
if (!c->scene) {
|
||||
|
|
|
|||
|
|
@ -325,7 +325,7 @@ void init_fadeout_layers(LayerSurface *l) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!l->mon || !l->scene)
|
||||
if (!l->mon || !l->scene || l->mon->iscleanuping)
|
||||
return;
|
||||
|
||||
if ((l->animation_type_close &&
|
||||
|
|
|
|||
25
src/mango.c
25
src/mango.c
|
|
@ -519,6 +519,7 @@ struct Monitor {
|
|||
uint32_t resizing_count_pending;
|
||||
uint32_t resizing_count_current;
|
||||
struct wlr_scene_tree *layers_scene_tree[NUM_LAYERS];
|
||||
bool iscleanuping;
|
||||
|
||||
struct wl_list dwl_ipc_outputs;
|
||||
int32_t gappih; /* horizontal gap between windows */
|
||||
|
|
@ -2254,11 +2255,27 @@ void cleanupmon(struct wl_listener *listener, void *data) {
|
|||
Monitor *m = wl_container_of(listener, m, destroy);
|
||||
LayerSurface *l = NULL, *tmp = NULL;
|
||||
uint32_t i;
|
||||
m->iscleanuping = true;
|
||||
|
||||
/* m->layers[i] are intentionally not unlinked */
|
||||
for (i = 0; i < LENGTH(m->layers); i++) {
|
||||
wl_list_for_each_safe(l, tmp, &m->layers[i], link)
|
||||
wl_list_for_each_safe(l, tmp, &m->layers[i], link) {
|
||||
wlr_layer_surface_v1_destroy(l->layer_surface);
|
||||
}
|
||||
}
|
||||
|
||||
LayerSurface *l_tmp, *l_safe;
|
||||
wl_list_for_each_safe(l_tmp, l_safe, &fadeout_layers, fadeout_link) {
|
||||
if (l_tmp->mon == m) {
|
||||
wlr_scene_node_reparent(&l_tmp->scene->node, layers[LyrFadeOut]);
|
||||
}
|
||||
}
|
||||
|
||||
Client *c_tmp, *c_safe;
|
||||
wl_list_for_each_safe(c_tmp, c_safe, &fadeout_clients, link) {
|
||||
if (c_tmp->mon == m) {
|
||||
wlr_scene_node_reparent(&c_tmp->scene->node, layers[LyrFadeOut]);
|
||||
}
|
||||
}
|
||||
|
||||
// clean ext-workspaces grouplab
|
||||
|
|
@ -2285,6 +2302,11 @@ void cleanupmon(struct wl_listener *listener, void *data) {
|
|||
}
|
||||
|
||||
m->wlr_output->data = NULL;
|
||||
|
||||
for (i = 0; i < NUM_LAYERS; i++) {
|
||||
wlr_scene_node_destroy(&m->layers_scene_tree[i]->node);
|
||||
}
|
||||
|
||||
free(m->pertag);
|
||||
free(m);
|
||||
}
|
||||
|
|
@ -2854,6 +2876,7 @@ void createmon(struct wl_listener *listener, void *data) {
|
|||
m->skiping_frame = false;
|
||||
m->resizing_count_pending = 0;
|
||||
m->resizing_count_current = 0;
|
||||
m->iscleanuping = false;
|
||||
|
||||
m->wlr_output = wlr_output;
|
||||
m->wlr_output->data = m;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue