mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-05-28 21:37:28 -04:00
fix: add support for _have_client movement
This commit is contained in:
parent
2f95b11258
commit
c9ac0582e2
1 changed files with 38 additions and 16 deletions
|
|
@ -1567,16 +1567,13 @@ int32_t viewtoleft_have_client(const Arg *arg) {
|
|||
if (!selmon)
|
||||
return 0;
|
||||
|
||||
if (selmon->isoverview)
|
||||
return 0;
|
||||
|
||||
uint32_t n;
|
||||
uint32_t current = get_tags_first_tag_num(selmon->tagset[selmon->seltags]);
|
||||
bool found = false;
|
||||
|
||||
if (selmon->isoverview) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (current <= 1)
|
||||
return 0;
|
||||
bool wrapped = false;
|
||||
|
||||
for (n = current - 1; n >= 1; n--) {
|
||||
if (get_tag_status(n, selmon)) {
|
||||
|
|
@ -1585,8 +1582,22 @@ int32_t viewtoleft_have_client(const Arg *arg) {
|
|||
}
|
||||
}
|
||||
|
||||
if (found)
|
||||
if (!found && config.tag_carousel) {
|
||||
for (n = LENGTH(tags); n > current; n--) {
|
||||
if (get_tag_status(n, selmon)) {
|
||||
found = true;
|
||||
wrapped = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (found) {
|
||||
if (wrapped)
|
||||
selmon->carousel_anim_dir = -1;
|
||||
view(&(Arg){.ui = (1 << (n - 1)) & TAGMASK, .i = arg->i}, true);
|
||||
selmon->carousel_anim_dir = 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1594,16 +1605,13 @@ int32_t viewtoright_have_client(const Arg *arg) {
|
|||
if (!selmon)
|
||||
return 0;
|
||||
|
||||
if (selmon->isoverview)
|
||||
return 0;
|
||||
|
||||
uint32_t n;
|
||||
uint32_t current = get_tags_first_tag_num(selmon->tagset[selmon->seltags]);
|
||||
bool found = false;
|
||||
|
||||
if (selmon->isoverview) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (current >= LENGTH(tags))
|
||||
return 0;
|
||||
bool wrapped = false;
|
||||
|
||||
for (n = current + 1; n <= LENGTH(tags); n++) {
|
||||
if (get_tag_status(n, selmon)) {
|
||||
|
|
@ -1612,8 +1620,22 @@ int32_t viewtoright_have_client(const Arg *arg) {
|
|||
}
|
||||
}
|
||||
|
||||
if (found)
|
||||
if (!found && config.tag_carousel) {
|
||||
for (n = 1; n < current; n++) {
|
||||
if (get_tag_status(n, selmon)) {
|
||||
found = true;
|
||||
wrapped = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (found) {
|
||||
if (wrapped)
|
||||
selmon->carousel_anim_dir = 1;
|
||||
view(&(Arg){.ui = (1 << (n - 1)) & TAGMASK, .i = arg->i}, true);
|
||||
selmon->carousel_anim_dir = 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue