From ac48b764da4d0b6471424d56d6c512d12c77408a Mon Sep 17 00:00:00 2001 From: Eldar Yusupov Date: Sat, 13 Apr 2024 18:29:35 +0300 Subject: [PATCH] Fix crash when there is no active client --- restore-monitor/restore-monitor.patch | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/restore-monitor/restore-monitor.patch b/restore-monitor/restore-monitor.patch index b9b81ff..ab86e9a 100644 --- a/restore-monitor/restore-monitor.patch +++ b/restore-monitor/restore-monitor.patch @@ -1,14 +1,14 @@ -From 5994fd10cce0eedf95a89406fae0ff5699d0db77 Mon Sep 17 00:00:00 2001 +From 780e5ebcf6decdc8cedb69cf9c93446912903b83 Mon Sep 17 00:00:00 2001 From: Eldar Yusupov Date: Sun, 17 Mar 2024 19:12:29 +0300 Subject: [PATCH] Restore correct montior for client when it is reattached --- - dwl.c | 16 ++++++++++++++++ - 1 file changed, 16 insertions(+) + dwl.c | 22 +++++++++++++++++++++- + 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/dwl.c b/dwl.c -index bf763df..40d03dc 100644 +index bf763df..c413be8 100644 --- a/dwl.c +++ b/dwl.c @@ -107,6 +107,7 @@ typedef struct { @@ -60,12 +60,19 @@ index bf763df..40d03dc 100644 printstatus(); unset_fullscreen: -@@ -2567,6 +2581,8 @@ tagmon(const Arg *arg) +@@ -2565,8 +2579,14 @@ void + tagmon(const Arg *arg) + { Client *sel = focustop(selmon); - if (sel) +- if (sel) ++ if (sel) { setmon(sel, dirtomon(arg->i), 0); -+ free(sel->output); -+ sel->output = strdup(sel->mon->wlr_output->name); ++ free(sel->output); ++ sel->output = strdup(sel->mon->wlr_output->name); ++ if (sel->output == NULL) { ++ die("oom"); ++ } ++ } } void