opt: optimize scroller layout center client judge
This commit is contained in:
@@ -128,8 +128,9 @@ Client *center_tiled_select(Monitor *m) {
|
||||
int dirx, diry;
|
||||
long int distance;
|
||||
wl_list_for_each(c, &clients, link) {
|
||||
if (c && VISIBLEON(c, m) && ISTILED(c) && client_surface(c)->mapped &&
|
||||
!c->isfloating && !client_is_unmanaged(c)) {
|
||||
if (c && VISIBLEON(c, m) && ISSCROLLTILED(c) &&
|
||||
client_surface(c)->mapped && !c->isfloating &&
|
||||
!client_is_unmanaged(c)) {
|
||||
dirx = c->geom.x + c->geom.width / 2 - (m->w.x + m->w.width / 2);
|
||||
diry = c->geom.y + c->geom.height / 2 - (m->w.y + m->w.height / 2);
|
||||
distance = dirx * dirx + diry * diry;
|
||||
|
||||
@@ -284,7 +284,7 @@ void scroller(Monitor *m) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (m->sel && !client_is_unmanaged(m->sel) && !m->sel->isfloating) {
|
||||
if (m->sel && !client_is_unmanaged(m->sel) && ISSCROLLTILED(m->sel)) {
|
||||
root_client = m->sel;
|
||||
} else if (m->prevsel && ISSCROLLTILED(m->prevsel) &&
|
||||
VISIBLEON(m->prevsel, m) && !client_is_unmanaged(m->prevsel)) {
|
||||
|
||||
@@ -246,7 +246,7 @@ void vertical_scroller(Monitor *m) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (m->sel && !client_is_unmanaged(m->sel) && !m->sel->isfloating) {
|
||||
if (m->sel && !client_is_unmanaged(m->sel) && ISSCROLLTILED(m->sel)) {
|
||||
root_client = m->sel;
|
||||
} else if (m->prevsel && ISSCROLLTILED(m->prevsel) &&
|
||||
VISIBLEON(m->prevsel, m) && !client_is_unmanaged(m->prevsel)) {
|
||||
|
||||
Reference in New Issue
Block a user