opt: optimize slide animaiton dir judge
This commit is contained in:
@@ -28,23 +28,36 @@ enum corner_location set_client_corner_location(Client *c) {
|
|||||||
return current_corner_location;
|
return current_corner_location;
|
||||||
}
|
}
|
||||||
|
|
||||||
int is_special_animaiton_rule(Client *c) {
|
bool is_horizontal_stack_layout(Monitor *m) {
|
||||||
int visible_client_number = 0;
|
|
||||||
Client *count_c;
|
if (!m->pertag->curtag &&
|
||||||
wl_list_for_each(count_c, &clients, link) {
|
(strcmp(m->pertag->ltidxs[m->pertag->prevtag]->name, "tile") == 0 ||
|
||||||
if (count_c && VISIBLEON(count_c, selmon) && !count_c->isminied &&
|
strcmp(m->pertag->ltidxs[m->pertag->prevtag]->name, "spiral") == 0 ||
|
||||||
!count_c->iskilling && !count_c->isfloating) {
|
strcmp(m->pertag->ltidxs[m->pertag->prevtag]->name, "dwindle") == 0 ||
|
||||||
visible_client_number++;
|
strcmp(m->pertag->ltidxs[m->pertag->prevtag]->name, "deck") == 0))
|
||||||
}
|
return true;
|
||||||
|
|
||||||
|
if (m->pertag->curtag &&
|
||||||
|
(strcmp(m->pertag->ltidxs[m->pertag->curtag]->name, "tile") == 0 ||
|
||||||
|
strcmp(m->pertag->ltidxs[m->pertag->curtag]->name, "spiral") == 0 ||
|
||||||
|
strcmp(m->pertag->ltidxs[m->pertag->curtag]->name, "dwindle") == 0 ||
|
||||||
|
strcmp(m->pertag->ltidxs[m->pertag->curtag]->name, "deck") == 0))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_scroller_layout(selmon) && !c->isfloating) {
|
int is_special_animaiton_rule(Client *c) {
|
||||||
|
|
||||||
|
if (is_scroller_layout(c->mon) && !c->isfloating) {
|
||||||
return DOWN;
|
return DOWN;
|
||||||
} else if (visible_client_number < 2 && !c->isfloating) {
|
} else if (c->mon->visible_tiling_clients == 1 && !c->isfloating) {
|
||||||
return DOWN;
|
return DOWN;
|
||||||
} else if (visible_client_number == 2 && !c->isfloating && !new_is_master) {
|
} else if (c->mon->visible_tiling_clients == 2 && !c->isfloating &&
|
||||||
|
!new_is_master && is_horizontal_stack_layout(c->mon)) {
|
||||||
return RIGHT;
|
return RIGHT;
|
||||||
} else if (!c->isfloating && new_is_master) {
|
} else if (!c->isfloating && new_is_master &&
|
||||||
|
is_horizontal_stack_layout(c->mon)) {
|
||||||
return LEFT;
|
return LEFT;
|
||||||
} else {
|
} else {
|
||||||
return UNDIR;
|
return UNDIR;
|
||||||
|
|||||||
Reference in New Issue
Block a user