From 9506523f3286cd2540d27e1b2bd629e912737131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Desgualdo=20Pereira?= Date: Wed, 29 Oct 2025 09:12:39 -0300 Subject: [PATCH] add focus on urgent patch --- patches/focusonurgent/README.md | 14 +++++++++++ patches/focusonurgent/focusonurgent.patch | 29 +++++++++++++++++++++++ 2 files changed, 43 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..2bef3e4 --- /dev/null +++ b/patches/focusonurgent/README.md @@ -0,0 +1,14 @@ +### Description + +By default, dwl responds 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. +If you want a more controlled behavior, for example setting which clients can focus, check [activation-rule patch](https://codeberg.org/sevz/dwl-patches/src/branch/activation-rules). + +### 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..988090c --- /dev/null +++ b/patches/focusonurgent/focusonurgent.patch @@ -0,0 +1,29 @@ +From 3613d9a6342fc85279a79ba203f25ff39fc0d8e4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andr=C3=A9=20Desgualdo=20Pereira?= +Date: Wed, 29 Oct 2025 09:06:00 -0300 +Subject: [PATCH] add focusonurgent patch + +--- + dwl.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/dwl.c b/dwl.c +index 12f441e..5620f66 100644 +--- a/dwl.c ++++ b/dwl.c +@@ -2097,8 +2097,10 @@ printstatus(void) + if (c->mon != m) + continue; + occ |= c->tags; +- if (c->isurgent) +- urg |= c->tags; ++ if (c->isurgent) { ++ 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)); +-- +2.51.0 +