mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-06-30 13:14:45 -04:00
opt: Adopt a more flexible way to control window hiding
This commit is contained in:
parent
5686bdc95c
commit
b73cd4ef90
5 changed files with 21 additions and 45 deletions
|
|
@ -819,8 +819,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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -242,9 +242,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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
50
src/mango.c
50
src/mango.c
|
|
@ -126,7 +126,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])
|
||||
|
|
@ -473,6 +473,7 @@ struct Client {
|
|||
Client *group_prev;
|
||||
Client *group_next;
|
||||
bool isgroupfocusing;
|
||||
bool is_logic_hide;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -1375,32 +1376,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,
|
||||
|
|
@ -4574,6 +4557,7 @@ static void iter_xdg_scene_buffers(struct wlr_scene_buffer *buffer, int32_t sx,
|
|||
}
|
||||
|
||||
void init_client_properties(Client *c) {
|
||||
c->is_logic_hide = false;
|
||||
c->isgroupfocusing = false;
|
||||
c->group_prev = NULL;
|
||||
c->group_next = NULL;
|
||||
|
|
@ -6902,8 +6886,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;
|
||||
}
|
||||
|
|
@ -6915,19 +6897,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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue