mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-10-31 22:25:29 -04:00
opt:Avoid an infinite loop
This commit is contained in:
parent
ede1f880b9
commit
567f91f352
1 changed files with 6 additions and 2 deletions
|
|
@ -5327,7 +5327,7 @@ unsigned int get_tags_first_tag(unsigned int source_tags) {
|
|||
return selmon->pertag->curtag;
|
||||
}
|
||||
|
||||
for (i = 0; !(tag & 1); i++) {
|
||||
for (i = 0; !(tag & 1) && source_tags != 0; i++) {
|
||||
tag = source_tags >> i;
|
||||
}
|
||||
target = 1 << (i - 1);
|
||||
|
|
@ -6820,6 +6820,10 @@ void view_in_mon(const Arg *arg, bool want_animation, Monitor *m) {
|
|||
if (!m || (arg->ui != ~0 && m->isoverview)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (arg->ui == 0)
|
||||
return;
|
||||
|
||||
// if ((m->tagset[m->seltags] & arg->ui & TAGMASK) != 0) {
|
||||
// want_animation = false;
|
||||
// }
|
||||
|
|
@ -6832,7 +6836,7 @@ void view_in_mon(const Arg *arg, bool want_animation, Monitor *m) {
|
|||
if (arg->ui == ~0)
|
||||
m->pertag->curtag = 0;
|
||||
else {
|
||||
for (i = 0; !(arg->ui & 1 << i); i++)
|
||||
for (i = 0; !(arg->ui & 1 << i) && arg->ui != 0; i++)
|
||||
;
|
||||
m->pertag->curtag = i + 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue