From ec3f13bb73fccb5703746196f953b1642af7bc03 Mon Sep 17 00:00:00 2001 From: James Rupert Tan Date: Sun, 10 Sep 2023 01:43:27 -0400 Subject: [PATCH 1/2] Resolve segfault on alt-tab after closing last window --- sowm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sowm.c b/sowm.c index 96f8340..f11da4d 100644 --- a/sowm.c +++ b/sowm.c @@ -113,7 +113,7 @@ void win_del(Window w) { for win if (c->w == w) x = c; if (!list || !x) return; - if (x->prev == x) list = 0; + if (x->prev == x) list = cur = 0; if (list == x) list = x->next; if (x->next) x->next->prev = x->prev; if (x->prev) x->prev->next = x->next; From 3b1536bc5e6a4d135190612e13d1d5635b86e08e Mon Sep 17 00:00:00 2001 From: James Rupert Tan Date: Sun, 10 Sep 2023 19:18:00 -0400 Subject: [PATCH 2/2] Resolve bug when moving last window in a workspace to another. * Caused by previous change to win_del --- sowm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sowm.c b/sowm.c index f11da4d..931b059 100644 --- a/sowm.c +++ b/sowm.c @@ -155,8 +155,8 @@ void win_to_ws(const Arg arg) { ws_save(arg.i); ws_sel(tmp); - win_del(cur->w); XUnmapWindow(d, cur->w); + win_del(cur->w); ws_save(tmp); if (list) win_focus(list);