diff --git a/src/animation/client.h b/src/animation/client.h index 6f897a88..4a176676 100644 --- a/src/animation/client.h +++ b/src/animation/client.h @@ -661,8 +661,10 @@ struct ivec2 clip_to_hide(Client *c, struct wlr_box *clip_box) { (ISSCROLLTILED(c) || c->animation.tagouting || c->animation.tagining)) { c->is_clip_to_hide = true; wlr_scene_node_set_enabled(&c->scene->node, false); - } else if (c->is_clip_to_hide && VISIBLEON(c, c->mon)) { + } else if (c->is_clip_to_hide && VISIBLEON(c, c->mon) && + !c->is_logic_hide) { c->is_clip_to_hide = false; + c->is_logic_hide = false; wlr_scene_node_set_enabled(&c->scene->node, true); } diff --git a/src/animation/tag.h b/src/animation/tag.h index 9ff5908f..d61429b8 100644 --- a/src/animation/tag.h +++ b/src/animation/tag.h @@ -45,8 +45,10 @@ void set_tagin_animation(Monitor *m, Client *c) { void set_arrange_visible(Monitor *m, Client *c, bool want_animation) { - if (!ISTILED(c) || (!c->is_clip_to_hide || !is_scroller_layout(c->mon))) { + if ((!ISTILED(c) || (!c->is_clip_to_hide || !is_scroller_layout(c->mon))) && + !c->is_logic_hide) { c->is_clip_to_hide = false; + c->is_logic_hide = false; wlr_scene_node_set_enabled(&c->scene->node, true); wlr_scene_node_set_enabled(&c->scene_surface->node, true); } diff --git a/src/dispatch/bind_define.h b/src/dispatch/bind_define.h index 32c759a7..e0973234 100644 --- a/src/dispatch/bind_define.h +++ b/src/dispatch/bind_define.h @@ -243,9 +243,7 @@ int32_t groupleave(const Arg *arg) { tc->group_prev = NULL; tc->group_next = NULL; tc->isgroupfocusing = false; - - wl_list_insert(&rc->link, &tc->link); - wl_list_insert(&rc->flink, &tc->flink); + tc->is_logic_hide = false; if (!rc->group_prev && !rc->group_next) { rc->isgroupfocusing = false; diff --git a/src/fetch/client.h b/src/fetch/client.h index e7d8e673..20be6596 100644 --- a/src/fetch/client.h +++ b/src/fetch/client.h @@ -188,6 +188,8 @@ Client *find_client_by_direction(Client *tc, const Arg *arg, continue; if (!findfloating && c->isfloating) continue; + if (c->is_logic_hide) + continue; if (c->isunglobal) continue; if (!config.focus_cross_monitor && c->mon != tc->mon) @@ -442,7 +444,7 @@ Client *get_focused_stack_client(Client *sc, Client *custom_focus_client) { return sc; wl_list_for_each(tc, &fstack, flink) { - if (tc->iskilling || tc->isunglobal) + if (tc->iskilling || tc->isunglobal || tc->is_logic_hide) continue; if (!VISIBLEON(tc, sc->mon)) continue; diff --git a/src/mango.c b/src/mango.c index adbcdff4..b079ec23 100644 --- a/src/mango.c +++ b/src/mango.c @@ -123,7 +123,7 @@ (A && !(A)->isfloating && !(A)->isminimized && !(A)->iskilling && \ !(A)->isunglobal) #define VISIBLEON(C, M) \ - ((C) && (M) && (C)->mon == (M) && \ + ((C) && (M) && (C)->mon == (M) && !(C)->is_logic_hide && \ (((C)->tags & (M)->tagset[(M)->seltags] || (C)->isglobal || \ (C)->isunglobal))) #define LENGTH(X) (sizeof X / sizeof X[0]) @@ -466,6 +466,7 @@ struct Client { Client *group_prev; Client *group_next; bool isgroupfocusing; + bool is_logic_hide; }; typedef struct { @@ -1367,32 +1368,14 @@ void client_replace(Client *c, Client *w, bool isgroupaction) { wlr_scene_node_set_enabled(&w->group_bar->scene_buffer->node, false); } - if (c->link.prev && c->link.next && c->link.prev != &c->link) { - wl_list_remove(&c->link); - } - wl_list_init(&c->link); + wl_list_remove(&c->link); + wl_list_insert(&w->link, &c->link); - if (c->flink.prev && c->flink.next && c->flink.prev != &c->flink) { - wl_list_remove(&c->flink); - } - wl_list_init(&c->flink); + wl_list_remove(&c->flink); + wl_list_insert(&w->flink, &c->flink); - if (w->link.prev && w->link.next && w->link.prev != &w->link) { - wl_list_insert(w->link.prev, &c->link); - wl_list_remove(&w->link); - wl_list_init(&w->link); - } - - if (w->flink.prev && w->flink.next && w->flink.prev != &w->flink) { - if (selmon && c == selmon->sel) { - wl_list_insert(&fstack, &c->flink); - } else { - wl_list_insert(w->flink.prev, &c->flink); - } - wl_list_remove(&w->flink); - wl_list_init(&w->flink); - } - /* --------------------------------------------------------------------- */ + w->is_logic_hide = true; + c->is_logic_hide = false; if (w->foreign_toplevel) { wlr_foreign_toplevel_handle_v1_output_leave(w->foreign_toplevel, @@ -4463,6 +4446,7 @@ void locksession(struct wl_listener *listener, void *data) { } void init_client_properties(Client *c) { + c->is_logic_hide = false; c->isgroupfocusing = false; c->group_prev = NULL; c->group_next = NULL; @@ -6759,8 +6743,6 @@ void unmapnotify(struct wl_listener *listener, void *data) { focusclient(focustop(selmon), 1); } else { - bool is_in_group = c->group_next || c->group_prev; - if (c->group_next && !c->isgroupfocusing) { c->group_next->group_prev = c->group_prev; } @@ -6772,19 +6754,9 @@ void unmapnotify(struct wl_listener *listener, void *data) { c->group_next = NULL; c->group_prev = NULL; - if (!c->swallowing && (!is_in_group || c->isgroupfocusing)) { - if (c->link.prev && c->link.next && c->link.prev != &c->link) { - wl_list_remove(&c->link); - wl_list_init(&c->link); - } - } + wl_list_remove(&c->link); setmon(c, NULL, 0, true); - if (!c->swallowing && (!is_in_group || c->isgroupfocusing)) { - if (c->flink.prev && c->flink.next && c->flink.prev != &c->flink) { - wl_list_remove(&c->flink); - wl_list_init(&c->flink); - } - } + wl_list_remove(&c->flink); } if (c->foreign_toplevel) {