mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-10-31 22:25:29 -04: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,8 +2466,10 @@ void closemon(Monitor *m) {
|
|||
} else {
|
||||
client_change_mon(c, selmon);
|
||||
}
|
||||
|
||||
client_update_oldmonname_record(c, m);
|
||||
// record the oldmonname which is used to restore
|
||||
if (c->oldmonname[0] == '\0') {
|
||||
client_update_oldmonname_record(c, m);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (selmon) {
|
||||
|
|
@ -5684,7 +5686,7 @@ void tagsilent(const Arg *arg) {
|
|||
}
|
||||
|
||||
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;
|
||||
memset(c->oldmonname, 0, sizeof(c->oldmonname));
|
||||
strncpy(c->oldmonname, m->wlr_output->name, sizeof(c->oldmonname) - 1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue