diff --git a/src/fetch/client.h b/src/fetch/client.h index 49499f9..4ecd93c 100644 --- a/src/fetch/client.h +++ b/src/fetch/client.h @@ -121,14 +121,14 @@ static bool is_window_rule_matches(const ConfigWinRule *r, const char *appid, regex_match(r->title, title)); } -Client *center_select(Monitor *m) { +Client *center_tiled_select(Monitor *m) { Client *c = NULL; Client *target_c = NULL; long int mini_distance = -1; int dirx, diry; long int distance; wl_list_for_each(c, &clients, link) { - if (c && VISIBLEON(c, m) && client_surface(c)->mapped && + if (c && VISIBLEON(c, m) && ISTILED(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); diff --git a/src/layout/horizontal.h b/src/layout/horizontal.h index 40cc592..0334c48 100644 --- a/src/layout/horizontal.h +++ b/src/layout/horizontal.h @@ -357,11 +357,11 @@ void scroller(Monitor *m) { if (m->sel && !client_is_unmanaged(m->sel) && !m->sel->isfloating && !m->sel->ismaxmizescreen && !m->sel->isfullscreen) { root_client = m->sel; - } else if (m->prevsel && ISTILED(m->prevsel) && + } else if (m->prevsel && ISTILED(m->prevsel) && VISIBLEON(m->prevsel, m) && !client_is_unmanaged(m->prevsel)) { root_client = m->prevsel; } else { - root_client = center_select(m); + root_client = center_tiled_select(m); } if (!root_client) { diff --git a/src/layout/vertical.h b/src/layout/vertical.h index 44d49a7..96d0005 100644 --- a/src/layout/vertical.h +++ b/src/layout/vertical.h @@ -344,11 +344,11 @@ void vertical_scroller(Monitor *m) { if (m->sel && !client_is_unmanaged(m->sel) && !m->sel->isfloating && !m->sel->ismaxmizescreen && !m->sel->isfullscreen) { root_client = m->sel; - } else if (m->prevsel && ISTILED(m->prevsel) && + } else if (m->prevsel && ISTILED(m->prevsel) && VISIBLEON(m->prevsel, m) && !client_is_unmanaged(m->prevsel)) { root_client = m->prevsel; } else { - root_client = center_select(m); + root_client = center_tiled_select(m); } if (!root_client) { diff --git a/src/mango.c b/src/mango.c index bcad2a4..efdbb92 100644 --- a/src/mango.c +++ b/src/mango.c @@ -669,7 +669,7 @@ static void snap_scene_buffer_apply_effect(struct wlr_scene_buffer *buffer, static void client_set_pending_state(Client *c); static void layer_set_pending_state(LayerSurface *l); static void set_rect_size(struct wlr_scene_rect *rect, int width, int height); -static Client *center_select(Monitor *m); +static Client *center_tiled_select(Monitor *m); static void handlecursoractivity(void); static int hidecursor(void *data); static bool check_hit_no_border(Client *c); @@ -3519,7 +3519,7 @@ mapnotify(struct wl_listener *listener, void *data) { VISIBLEON(selmon->sel, selmon)) { at_client = selmon->sel; } else { - at_client = center_select(selmon); + at_client = center_tiled_select(selmon); } at_client->link.next->prev = &c->link;