mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-10-29 05:40:21 -04:00
fix: foreign toplevel release miss
fix:cerash about last change
This commit is contained in:
parent
a0fb309d9a
commit
23d261e26b
1 changed files with 39 additions and 13 deletions
52
main.c
52
main.c
|
|
@ -2903,29 +2903,30 @@ void pending_kill_client(Client *c) {
|
||||||
c->pending = c->geom;
|
c->pending = c->geom;
|
||||||
c->pending.y = c->geom.y + c->mon->m.height;
|
c->pending.y = c->geom.y + c->mon->m.height;
|
||||||
|
|
||||||
if (c == selmon->sel)
|
|
||||||
selmon->sel = NULL;
|
|
||||||
|
|
||||||
if (c == grabc) {
|
if (c == grabc) {
|
||||||
cursor_mode = CurNormal;
|
cursor_mode = CurNormal;
|
||||||
grabc = NULL;
|
grabc = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (c == selmon->sel) {
|
||||||
|
selmon->sel = NULL;
|
||||||
|
Client *nextfocus = focustop(selmon);
|
||||||
|
|
||||||
|
if(nextfocus) {
|
||||||
|
focusclient(nextfocus,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!nextfocus && selmon->isoverview){
|
||||||
|
Arg arg = {0};
|
||||||
|
toggleoverview(&arg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(c->foreign_toplevel){
|
if(c->foreign_toplevel){
|
||||||
wlr_foreign_toplevel_handle_v1_destroy(c->foreign_toplevel);
|
wlr_foreign_toplevel_handle_v1_destroy(c->foreign_toplevel);
|
||||||
c->foreign_toplevel = NULL;
|
c->foreign_toplevel = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Client *nextfocus = focustop(selmon);
|
|
||||||
|
|
||||||
if(nextfocus) {
|
|
||||||
focusclient(nextfocus,0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!nextfocus && selmon->isoverview){
|
|
||||||
Arg arg = {0};
|
|
||||||
toggleoverview(&arg);
|
|
||||||
}
|
|
||||||
resize(c,c->geom,0);
|
resize(c,c->geom,0);
|
||||||
printstatus();
|
printstatus();
|
||||||
motionnotify(0, NULL, 0, 0, 0, 0);
|
motionnotify(0, NULL, 0, 0, 0, 0);
|
||||||
|
|
@ -4903,6 +4904,25 @@ unmapnotify(struct wl_listener *listener, void *data)
|
||||||
/* Called when the surface is unmapped, and should no longer be shown. */
|
/* Called when the surface is unmapped, and should no longer be shown. */
|
||||||
Client *c = wl_container_of(listener, c, unmap);
|
Client *c = wl_container_of(listener, c, unmap);
|
||||||
|
|
||||||
|
if (c == grabc) {
|
||||||
|
cursor_mode = CurNormal;
|
||||||
|
grabc = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (c == selmon->sel) {
|
||||||
|
selmon->sel = NULL;
|
||||||
|
Client *nextfocus = focustop(selmon);
|
||||||
|
|
||||||
|
if(nextfocus) {
|
||||||
|
focusclient(nextfocus,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!nextfocus && selmon->isoverview){
|
||||||
|
Arg arg = {0};
|
||||||
|
toggleoverview(&arg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (client_is_unmanaged(c)) {
|
if (client_is_unmanaged(c)) {
|
||||||
if (c == exclusive_focus)
|
if (c == exclusive_focus)
|
||||||
exclusive_focus = NULL;
|
exclusive_focus = NULL;
|
||||||
|
|
@ -4914,8 +4934,14 @@ unmapnotify(struct wl_listener *listener, void *data)
|
||||||
wl_list_remove(&c->flink);
|
wl_list_remove(&c->flink);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(c->foreign_toplevel){
|
||||||
|
wlr_foreign_toplevel_handle_v1_destroy(c->foreign_toplevel);
|
||||||
|
c->foreign_toplevel = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
wlr_scene_node_destroy(&c->scene->node);
|
wlr_scene_node_destroy(&c->scene->node);
|
||||||
printstatus();
|
printstatus();
|
||||||
|
motionnotify(0, NULL, 0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void //0.5
|
void //0.5
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue