From 4f48dc6461956180de26efa345505fd27153862a Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Sat, 27 Sep 2025 08:48:24 +0800 Subject: [PATCH] opt: not reset tagset when show scratchpad --- src/dispatch/bind_define.h | 2 +- src/mango.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/dispatch/bind_define.h b/src/dispatch/bind_define.h index 2726b4e..70b5cda 100644 --- a/src/dispatch/bind_define.h +++ b/src/dispatch/bind_define.h @@ -415,10 +415,10 @@ void restore_minimized(const Arg *arg) { wl_list_for_each(c, &clients, link) { if (c->isminied) { - show_hide_client(c); c->is_scratchpad_show = 0; c->is_in_scratchpad = 0; c->isnamedscratchpad = 0; + show_hide_client(c); setborder_color(c); arrange(c->mon, false); focusclient(c, 0); diff --git a/src/mango.c b/src/mango.c index 805243c..9ffef0b 100644 --- a/src/mango.c +++ b/src/mango.c @@ -4543,8 +4543,12 @@ void setsel(struct wl_listener *listener, void *data) { void show_hide_client(Client *c) { unsigned int target = get_tags_first_tag(c->oldtags); - tag_client(&(Arg){.ui = target}, c); - // c->tags = c->oldtags; + if (!c->is_in_scratchpad) { + tag_client(&(Arg){.ui = target}, c); + } else { + c->tags = c->oldtags; + arrange(c->mon, false); + } c->isminied = 0; wlr_foreign_toplevel_handle_v1_set_minimized(c->foreign_toplevel, false); focusclient(c, 1);