mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-11-03 09:01:47 -05:00
opt: optimize the oldmon record
This commit is contained in:
parent
bb4a202ae3
commit
84c0a8f3d0
1 changed files with 5 additions and 3 deletions
|
|
@ -2466,10 +2466,12 @@ void closemon(Monitor *m) {
|
||||||
} else {
|
} else {
|
||||||
client_change_mon(c, selmon);
|
client_change_mon(c, selmon);
|
||||||
}
|
}
|
||||||
|
// record the oldmonname which is used to restore
|
||||||
|
if (c->oldmonname[0] == '\0') {
|
||||||
client_update_oldmonname_record(c, m);
|
client_update_oldmonname_record(c, m);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (selmon) {
|
if (selmon) {
|
||||||
focusclient(focustop(selmon), 1);
|
focusclient(focustop(selmon), 1);
|
||||||
printstatus();
|
printstatus();
|
||||||
|
|
@ -5684,7 +5686,7 @@ void tagsilent(const Arg *arg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void client_update_oldmonname_record(Client *c, Monitor *m) {
|
void client_update_oldmonname_record(Client *c, Monitor *m) {
|
||||||
if (!c || c->iskilling || !client_surface(c)->mapped || c->mon == m)
|
if (!c || c->iskilling || !client_surface(c)->mapped)
|
||||||
return;
|
return;
|
||||||
memset(c->oldmonname, 0, sizeof(c->oldmonname));
|
memset(c->oldmonname, 0, sizeof(c->oldmonname));
|
||||||
strncpy(c->oldmonname, m->wlr_output->name, sizeof(c->oldmonname) - 1);
|
strncpy(c->oldmonname, m->wlr_output->name, sizeof(c->oldmonname) - 1);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue