diff --git a/restore-monitor/restore-monitor.patch b/restore-monitor/restore-monitor.patch index ab86e9a..0d6da98 100644 --- a/restore-monitor/restore-monitor.patch +++ b/restore-monitor/restore-monitor.patch @@ -1,14 +1,14 @@ -From 780e5ebcf6decdc8cedb69cf9c93446912903b83 Mon Sep 17 00:00:00 2001 +From e42ca1c539437d3098d80983cfe2ad6f938d7a08 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 | 22 +++++++++++++++++++++- - 1 file changed, 21 insertions(+), 1 deletion(-) + dwl.c | 24 ++++++++++++++++++++++-- + 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/dwl.c b/dwl.c -index bf763df..c413be8 100644 +index bf763df..d8d8139 100644 --- a/dwl.c +++ b/dwl.c @@ -107,6 +107,7 @@ typedef struct { @@ -65,13 +65,14 @@ index bf763df..c413be8 100644 { Client *sel = focustop(selmon); - if (sel) -+ if (sel) { - setmon(sel, dirtomon(arg->i), 0); -+ free(sel->output); -+ sel->output = strdup(sel->mon->wlr_output->name); -+ if (sel->output == NULL) { -+ die("oom"); -+ } +- setmon(sel, dirtomon(arg->i), 0); ++ if (!sel) ++ return; ++ setmon(sel, dirtomon(arg->i), 0); ++ free(sel->output); ++ sel->output = strdup(sel->mon->wlr_output->name); ++ if (sel->output == NULL) { ++ die("oom"); + } }