mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-05-03 06:46:38 -04:00
fix: crash after change session
This commit is contained in:
parent
948eb7bb32
commit
15f2056c14
1 changed files with 12 additions and 5 deletions
17
maomao.c
17
maomao.c
|
|
@ -2216,11 +2216,18 @@ closemon(Monitor *m)
|
||||||
if (c->isfloating && c->geom.x > m->m.width)
|
if (c->isfloating && c->geom.x > m->m.width)
|
||||||
resize(c, (struct wlr_box){.x = c->geom.x - m->w.width, .y = c->geom.y,
|
resize(c, (struct wlr_box){.x = c->geom.x - m->w.width, .y = c->geom.y,
|
||||||
.width = c->geom.width, .height = c->geom.height}, 0);
|
.width = c->geom.width, .height = c->geom.height}, 0);
|
||||||
if (c->mon == m)
|
if (c->mon == m) {
|
||||||
setmon(c, selmon, c->tags);
|
if(selmon == NULL) {
|
||||||
|
c->mon = NULL;
|
||||||
|
} else {
|
||||||
|
setmon(c, selmon, c->tags);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
focusclient(focustop(selmon), 1);
|
if(selmon) {
|
||||||
printstatus();
|
focusclient(focustop(selmon), 1);
|
||||||
|
printstatus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -3128,7 +3135,7 @@ void focusclient(Client *c, int lift) {
|
||||||
if (c && lift)
|
if (c && lift)
|
||||||
wlr_scene_node_raise_to_top(&c->scene->node); // 将视图提升到顶层
|
wlr_scene_node_raise_to_top(&c->scene->node); // 将视图提升到顶层
|
||||||
|
|
||||||
if (c && client_surface(c) == old_keyboard_focus_surface)
|
if (c && client_surface(c) == old_keyboard_focus_surface && selmon && selmon->sel)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (selmon && selmon->sel && selmon->sel->foreign_toplevel) {
|
if (selmon && selmon->sel && selmon->sel->foreign_toplevel) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue