From ede1f880b9ce3c1caa61a01ad4a18f75911fdd5b Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Sun, 20 Apr 2025 08:17:48 +0800 Subject: [PATCH] fix:getting stuck in an infinite loop when attempting to activate a client in tag 0 --- src/maomao.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/maomao.c b/src/maomao.c index 4b4eed4..fd3ef92 100644 --- a/src/maomao.c +++ b/src/maomao.c @@ -1383,6 +1383,9 @@ swallow(Client *c, Client *w) c->isurgent = w->isurgent; c->isfullscreen = w->isfullscreen; c->ismaxmizescreen = w->ismaxmizescreen; + c->isminied = w->isminied; + c->is_in_scratchpad = w->is_in_scratchpad; + c->is_scratchpad_show = w->is_scratchpad_show; c->tags = w->tags; c->geom = w->geom; c->scroller_proportion = w->scroller_proportion; @@ -1398,6 +1401,11 @@ swallow(Client *c, Client *w) if(!c->foreign_toplevel && c->mon) add_foreign_toplevel(c); + if(c->isminied) { + wlr_foreign_toplevel_handle_v1_set_activated(c->foreign_toplevel, false); + wlr_foreign_toplevel_handle_v1_set_minimized(c->foreign_toplevel, true); + } + } void toggle_scratchpad(const Arg *arg) { @@ -5314,6 +5322,11 @@ setsel(struct wl_listener *listener, void *data) unsigned int get_tags_first_tag(unsigned int source_tags) { unsigned int i, target, tag; tag = 0; + + if(!source_tags) { + return selmon->pertag->curtag; + } + for (i = 0; !(tag & 1); i++) { tag = source_tags >> i; }