Tested on Ubuntu 24.10

>From f81e75510abf2d5660a5b2c19945aff028aa6ffa Mon Sep 17 00:00:00 2001
From: Mikhail Pchelin <mi...@freebsd.org>
Date: Tue, 21 Jan 2025 19:01:13 +0300
Subject: [PATCH] focus(): clear XUrgencyHint from the container window

---
 tabbed.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/tabbed.c b/tabbed.c
index e5664aa..28b0e6c 100644
--- a/tabbed.c
+++ b/tabbed.c
@@ -447,6 +447,7 @@ focus(int c)
        char buf[BUFSIZ] = "tabbed-"VERSION" ::";
        size_t i, n;
        XWMHints* wmh;
+       XWMHints* win_wmh;
 
        /* If c, sel and clients are -1, raise tabbed-win itself */
        if (nclients == 0) {
@@ -475,11 +476,21 @@ focus(int c)
                sel = c;
        }
 
-       if (clients[c]->urgent && (wmh = XGetWMHints(dpy, clients[c]->win))) {
+       if (clients[c]->urgent && (wmh = XGetWMHints(dpy, clients[c]->win)) &&
+           (win_wmh = XGetWMHints(dpy, win))) {
                wmh->flags &= ~XUrgencyHint;
                XSetWMHints(dpy, clients[c]->win, wmh);
                clients[c]->urgent = False;
                XFree(wmh);
+
+               /*
+                * gnome-shell will not stop notifying us about urgency,
+                * if we clear only the client hint and don't clear the
+                * hint from the main container window
+                */
+               win_wmh->flags &= ~XUrgencyHint;
+               XSetWMHints(dpy, win, win_wmh);
+               XFree(win_wmh);
        }
 
        drawbar();
-- 
2.45.2


Reply via email to