Re: [hackers] [tabbed][PATCH] focus(): clear XUrgencyHint from the container window

From: Mikhail Pchelin <misha_AT_freebsd.org>
Date: Wed, 22 Jan 2025 19:07:03 +0300

On Tue, Jan 21, 2025 at 08:27:53PM +0100, Hiltjo Posthuma wrote:
>
> Thanks for the patch, at a glance it looks good.
>
> Can anyone confirm this makes sense. I do not use gnome-shell myself.
 
Hi,

I made following patch to tabbed.c:

diff --git a/Makefile b/Makefile
index dda3cdb..964ef86 100644
diff --git a/tabbed.c b/tabbed.c
index e5664aa..40b31db 100644
--- a/tabbed.c
+++ b/tabbed.c
_AT_@ -482,6 +482,9 @@ focus(int c)
                 XFree(wmh);
         }
 
+ XWMHints *win_wmh = XGetWMHints(dpy, win);
+ printf("%s: win_wmh->flags=0x%lx\n", __func__, win_wmh->flags);
+
         drawbar();
         XSync(dpy, False);
 }

It prints hint flags for the parent window on every focus() call, then I
launched ./tabbed in a terminal and opened two tabs, in one of them
executed "sleep 2 && printf '\a'", then quickly switched to another tab.

When the bell has rung, urgency hint has been displayed on the tab,
switching to it cleared the tab color notification as expected, but on
the another switch back to the first tab, and on every further switches
between the tabs, in the console I can see:

focus: win_wmh->flags=0x100

(1 << 8) is the urgency hint.

I tested openbsd-current/cwm, debian-testing/xfce, and ubuntu/gnome - on
each of them urgency hint for the container window had been set on the
first urgency notification and not cleared afterwards, the result of it
is indefinite blinking and twitching of the tabbed icon/window button in
XFCE and Gnome, which can't be stopped by switching to the urgency tab,
the only was to stop it - tabbed restart.

I'm sorry for all that back and forth for such simple patch, I should
have tested more OS'es/DEs and present the results right in the first
mail and state the problem more clearly, also the patch I made in the
beginning was the one I sent second, without memory leak, late
simplification and over engineering always causes mistakes. Not my day,
definitely.

Here is the same patch with better commit message, I hope it's now clear
the problem I'm trying to fix and this way it can be easier for the
maintainers to decide.
Received on Wed Jan 22 2025 - 17:07:03 CET

This archive was generated by hypermail 2.3.0 : Wed Jan 22 2025 - 17:12:38 CET