From a3ca7c1aa4be62cd4230795270622f8f311ceb5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Desgualdo=20Pereira?= Date: Wed, 8 Oct 2025 12:43:19 -0300 Subject: [PATCH] Add focusonurgent: change dwl behavior to focus on the window that request urgency --- patches/focusonurgent/README.md | 12 ++++++++ patches/focusonurgent/focusonurgent.patch | 35 +++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 patches/focusonurgent/README.md create mode 100644 patches/focusonurgent/focusonurgent.patch diff --git a/patches/focusonurgent/README.md b/patches/focusonurgent/README.md new file mode 100644 index 0000000..b08cb5f --- /dev/null +++ b/patches/focusonurgent/README.md @@ -0,0 +1,12 @@ +### Description + +By default, dwl response to client requests to client messages by setting the urgency bit on the named window. +This patch changes the focus to the window instead. +Both behaviours are legitimate according to the cursed spec. +This is the approximately the equivalent of the focusonactive patch of dwm. + +### Download +- [git branch](https://codeberg.org/Kana/dwl/src/branch/focusonurgent) +- [main 2025-10-08](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/focusonurgent/focusonurgent.patch) +### Authors +- [André Desgualdo Pereira](https://codeberg.org/Kana) diff --git a/patches/focusonurgent/focusonurgent.patch b/patches/focusonurgent/focusonurgent.patch new file mode 100644 index 0000000..5cee739 --- /dev/null +++ b/patches/focusonurgent/focusonurgent.patch @@ -0,0 +1,35 @@ +From f250d06bdfbe45aaa56a316338ec2b2c143d91e3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andr=C3=A9=20Desgualdo=20Pereira?= +Date: Wed, 8 Oct 2025 12:03:27 -0300 +Subject: [PATCH] patch: By default, dwl response to client requests to client + messages by setting the urgency bit on the named window. This patch changes + the focus to the window instead. Both behaviours are legitimate according to + the cursed spec. This is the approximately the equivalent of the + focusonactive patch of dwm. + +--- + dwl.c | 3 ++- + focusonurgent.patch | 0 + 2 files changed, 2 insertions(+), 1 deletion(-) + create mode 100644 focusonurgent.patch + +diff --git a/dwl.c b/dwl.c +index 12f441e..760a66c 100644 +--- a/dwl.c ++++ b/dwl.c +@@ -2098,7 +2098,8 @@ printstatus(void) + continue; + occ |= c->tags; + if (c->isurgent) +- urg |= c->tags; ++ view(&((Arg){ .ui = c->tags })); ++ focusclient(c, 1); + } + if ((c = focustop(m))) { + printf("%s title %s\n", m->wlr_output->name, client_get_title(c)); +diff --git a/focusonurgent.patch b/focusonurgent.patch +new file mode 100644 +index 0000000..e69de29 +-- +2.51.0 +