mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-03-25 09:07:28 -04:00
opt: set scroller stack to same first tag
This commit is contained in:
parent
44fb6ce512
commit
8c8b4b34df
1 changed files with 6 additions and 11 deletions
|
|
@ -1775,28 +1775,19 @@ int32_t scroller_stack(const Arg *arg) {
|
||||||
if (!c || !c->mon || c->isfloating || !is_scroller_layout(selmon))
|
if (!c || !c->mon || c->isfloating || !is_scroller_layout(selmon))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (c && (!client_only_in_one_tag(c) || c->isglobal || c->isunglobal))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
bool is_horizontal_layout =
|
bool is_horizontal_layout =
|
||||||
c->mon->pertag->ltidxs[c->mon->pertag->curtag]->id == SCROLLER ? true
|
c->mon->pertag->ltidxs[c->mon->pertag->curtag]->id == SCROLLER ? true
|
||||||
: false;
|
: false;
|
||||||
|
|
||||||
Client *target_client = find_client_by_direction(c, arg, false, true);
|
Client *target_client = find_client_by_direction(c, arg, false, true);
|
||||||
|
|
||||||
if (target_client && (!client_only_in_one_tag(target_client) ||
|
|
||||||
target_client->isglobal || target_client->isunglobal))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (target_client) {
|
if (target_client) {
|
||||||
stack_head = get_scroll_stack_head(target_client);
|
stack_head = get_scroll_stack_head(target_client);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c) {
|
source_stack_head = get_scroll_stack_head(c);
|
||||||
source_stack_head = get_scroll_stack_head(c);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (stack_head == source_stack_head) {
|
if (source_stack_head == stack_head) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1844,6 +1835,10 @@ int32_t scroller_stack(const Arg *arg) {
|
||||||
|
|
||||||
if (!target_client || target_client->mon != c->mon) {
|
if (!target_client || target_client->mon != c->mon) {
|
||||||
return 0;
|
return 0;
|
||||||
|
} else {
|
||||||
|
c->isglobal = target_client->isglobal = 0;
|
||||||
|
c->isunglobal = target_client->isglobal = 0;
|
||||||
|
c->tags = target_client->tags = get_tags_first_tag(target_client->tags);
|
||||||
}
|
}
|
||||||
|
|
||||||
exit_scroller_stack(c);
|
exit_scroller_stack(c);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue