mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2025-10-27 10:14:16 +00:00
add titleurgent patch
This commit is contained in:
parent
a9a4b4e019
commit
f78cc828e1
@ -1,11 +0,0 @@
|
||||
### Description
|
||||
Whenever a client title changes set the client's urgent flag.
|
||||
|
||||
Hacky solution I use to deal with qutebrowser not setting urgent flag when a new tab is opened.
|
||||
|
||||
|
||||
### Download
|
||||
- [2023-10-23](https://github.com/djpohly/dwl/compare/main...bencollerson:title-change-urgent.patch)
|
||||
|
||||
### Authors
|
||||
- [Ben Collerson](https://github.com/bencollerson)
|
||||
81
titleurgent/titleurgent.patch
Normal file
81
titleurgent/titleurgent.patch
Normal file
@ -0,0 +1,81 @@
|
||||
From 853e2c854d92cff54badd6d55e5b2cd06f403202 Mon Sep 17 00:00:00 2001
|
||||
From: Ben Collerson <benc@benc.cc>
|
||||
Date: Fri, 29 Dec 2023 19:02:11 +1000
|
||||
Subject: [PATCH] titleurgent
|
||||
|
||||
---
|
||||
config.def.h | 8 +++++---
|
||||
dwl.c | 8 ++++++++
|
||||
2 files changed, 13 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/config.def.h b/config.def.h
|
||||
index a8ed61d9..cb90e252 100644
|
||||
--- a/config.def.h
|
||||
+++ b/config.def.h
|
||||
@@ -21,11 +21,13 @@ static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0}; /* You can al
|
||||
static int log_level = WLR_ERROR;
|
||||
|
||||
static const Rule rules[] = {
|
||||
- /* app_id title tags mask isfloating monitor */
|
||||
+ /* app_id title tags mask isfloating titleurgent monitor */
|
||||
/* examples:
|
||||
- { "Gimp", NULL, 0, 1, -1 },
|
||||
+ { "Gimp", NULL, 0, 1, 0, -1 },
|
||||
*/
|
||||
- { "firefox", NULL, 1 << 8, 0, -1 },
|
||||
+ { "firefox", NULL, 1 << 8, 0, 0, -1 },
|
||||
+ { "org.qutebrowser.qutebrowser",
|
||||
+ NULL, 0, 0, 1, -1 },
|
||||
};
|
||||
|
||||
/* layout(s) */
|
||||
diff --git a/dwl.c b/dwl.c
|
||||
index 4d19357f..6dc5d710 100644
|
||||
--- a/dwl.c
|
||||
+++ b/dwl.c
|
||||
@@ -133,6 +133,7 @@ typedef struct {
|
||||
unsigned int bw;
|
||||
uint32_t tags;
|
||||
int isfloating, isurgent, isfullscreen;
|
||||
+ int titleurgent;
|
||||
uint32_t resize; /* configure serial of a pending resize */
|
||||
} Client;
|
||||
|
||||
@@ -217,6 +218,7 @@ typedef struct {
|
||||
const char *title;
|
||||
uint32_t tags;
|
||||
int isfloating;
|
||||
+ int titleurgent;
|
||||
int monitor;
|
||||
} Rule;
|
||||
|
||||
@@ -431,6 +433,7 @@ applyrules(Client *c)
|
||||
Monitor *mon = selmon, *m;
|
||||
|
||||
c->isfloating = client_is_float_type(c);
|
||||
+ c->titleurgent = 0;
|
||||
if (!(appid = client_get_appid(c)))
|
||||
appid = broken;
|
||||
if (!(title = client_get_title(c)))
|
||||
@@ -440,6 +443,7 @@ applyrules(Client *c)
|
||||
if ((!r->title || strstr(title, r->title))
|
||||
&& (!r->id || strstr(appid, r->id))) {
|
||||
c->isfloating = r->isfloating;
|
||||
+ c->titleurgent = r->titleurgent;
|
||||
newtags |= r->tags;
|
||||
i = 0;
|
||||
wl_list_for_each(m, &mons, link) {
|
||||
@@ -2683,6 +2687,10 @@ updatetitle(struct wl_listener *listener, void *data)
|
||||
Client *c = wl_container_of(listener, c, set_title);
|
||||
if (c == focustop(c->mon))
|
||||
printstatus();
|
||||
+ else if (c->titleurgent) {
|
||||
+ c->isurgent = 1;
|
||||
+ printstatus();
|
||||
+ }
|
||||
}
|
||||
|
||||
void
|
||||
--
|
||||
2.43.0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user