opt: allow switch focus between fullscreen and floating window in focusstack

This commit is contained in:
DreamMaoMao 2025-10-27 12:46:04 +08:00
parent 04e3bd6861
commit 918a00d578
4 changed files with 13 additions and 2 deletions

View file

@ -212,7 +212,7 @@ int focusstack(const Arg *arg) {
Client *sel = focustop(selmon); Client *sel = focustop(selmon);
Client *tc = NULL; Client *tc = NULL;
if (!sel || (sel->isfullscreen && !client_has_children(sel))) if (!sel)
return 0; return 0;
if (arg->i == NEXT) { if (arg->i == NEXT) {
tc = get_next_stack_client(sel, false); tc = get_next_stack_client(sel, false);

View file

@ -343,11 +343,17 @@ Client *get_next_stack_client(Client *c, bool reverse) {
Client *next = NULL; Client *next = NULL;
if (reverse) { if (reverse) {
wl_list_for_each_reverse(next, &c->link, link) { 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) if (VISIBLEON(next, c->mon) && next != c)
return next; return next;
} }
} else { } else {
wl_list_for_each(next, &c->link, link) { 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) if (VISIBLEON(next, c->mon) && next != c)
return next; return next;
} }

View file

@ -592,6 +592,7 @@ arrange(Monitor *m, bool want_animation) {
return; return;
m->visible_clients = 0; m->visible_clients = 0;
m->visible_tiling_clients = 0; m->visible_tiling_clients = 0;
m->has_visible_fullscreen_client = false;
wl_list_for_each(c, &clients, link) { wl_list_for_each(c, &clients, link) {
@ -603,6 +604,10 @@ arrange(Monitor *m, bool want_animation) {
if (VISIBLEON(c, m)) { if (VISIBLEON(c, m)) {
m->visible_clients++; m->visible_clients++;
if (c->isfullscreen)
m->has_visible_fullscreen_client = true;
if (ISTILED(c)) { if (ISTILED(c)) {
m->visible_tiling_clients++; m->visible_tiling_clients++;
} }

View file

@ -443,6 +443,7 @@ struct Monitor {
int asleep; int asleep;
unsigned int visible_clients; unsigned int visible_clients;
unsigned int visible_tiling_clients; unsigned int visible_tiling_clients;
bool has_visible_fullscreen_client;
struct wlr_scene_optimized_blur *blur; struct wlr_scene_optimized_blur *blur;
char last_surface_ws_name[256]; char last_surface_ws_name[256];
struct wlr_ext_workspace_group_handle_v1 *ext_group; 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); // 将视图提升到顶层 wlr_scene_node_raise_to_top(&c->scene->node); // 将视图提升到顶层
resize(c, c->mon->m, 1); resize(c, c->mon->m, 1);
c->isfullscreen = 1; c->isfullscreen = 1;
// c->isfloating = 0;
} else { } else {
c->bw = c->isnoborder ? 0 : borderpx; c->bw = c->isnoborder ? 0 : borderpx;
c->isfullscreen = 0; c->isfullscreen = 0;