diff --git a/src/dispatch/bind_define.h b/src/dispatch/bind_define.h index 87babc3..21f2884 100644 --- a/src/dispatch/bind_define.h +++ b/src/dispatch/bind_define.h @@ -212,7 +212,7 @@ int focusstack(const Arg *arg) { Client *sel = focustop(selmon); Client *tc = NULL; - if (!sel || (sel->isfullscreen && !client_has_children(sel))) + if (!sel) return 0; if (arg->i == NEXT) { tc = get_next_stack_client(sel, false); diff --git a/src/fetch/client.h b/src/fetch/client.h index 24b0baf..609caa0 100644 --- a/src/fetch/client.h +++ b/src/fetch/client.h @@ -343,11 +343,17 @@ Client *get_next_stack_client(Client *c, bool reverse) { Client *next = NULL; if (reverse) { wl_list_for_each_reverse(next, &c->link, link) { + if (c->mon->has_visible_fullscreen_client && !next->isfloating && + !next->isfullscreen) + continue; if (VISIBLEON(next, c->mon) && next != c) return next; } } else { wl_list_for_each(next, &c->link, link) { + if (c->mon->has_visible_fullscreen_client && !next->isfloating && + !next->isfullscreen) + continue; if (VISIBLEON(next, c->mon) && next != c) return next; } diff --git a/src/layout/arrange.h b/src/layout/arrange.h index 18d6b15..c7935a9 100644 --- a/src/layout/arrange.h +++ b/src/layout/arrange.h @@ -592,6 +592,7 @@ arrange(Monitor *m, bool want_animation) { return; m->visible_clients = 0; m->visible_tiling_clients = 0; + m->has_visible_fullscreen_client = false; wl_list_for_each(c, &clients, link) { @@ -603,6 +604,10 @@ arrange(Monitor *m, bool want_animation) { if (VISIBLEON(c, m)) { m->visible_clients++; + + if (c->isfullscreen) + m->has_visible_fullscreen_client = true; + if (ISTILED(c)) { m->visible_tiling_clients++; } diff --git a/src/mango.c b/src/mango.c index dc459df..233c989 100644 --- a/src/mango.c +++ b/src/mango.c @@ -443,6 +443,7 @@ struct Monitor { int asleep; unsigned int visible_clients; unsigned int visible_tiling_clients; + bool has_visible_fullscreen_client; struct wlr_scene_optimized_blur *blur; char last_surface_ws_name[256]; struct wlr_ext_workspace_group_handle_v1 *ext_group; @@ -4531,7 +4532,6 @@ void setfullscreen(Client *c, int fullscreen) // 用自定义全屏代理自带 wlr_scene_node_raise_to_top(&c->scene->node); // 将视图提升到顶层 resize(c, c->mon->m, 1); c->isfullscreen = 1; - // c->isfloating = 0; } else { c->bw = c->isnoborder ? 0 : borderpx; c->isfullscreen = 0;