From 02f37be9e8a588484df15e4626611d74e8e7f464 Mon Sep 17 00:00:00 2001 From: vqn Date: Mon, 16 Dec 2024 10:45:56 +0100 Subject: [PATCH] Add `IGNOREURGENT` quirk --- spectrwm.1 | 2 ++ spectrwm.c | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/spectrwm.1 b/spectrwm.1 index d22a331..055f491 100644 --- a/spectrwm.1 +++ b/spectrwm.1 @@ -1966,6 +1966,8 @@ Especially useful for terminal windows that share a process. .It IGNORESPAWNWS Ignore the spawn workspace when determining the initial workspace for a new window. +.It IGNOREURGENT +Ignore urgency hint. .It MAXIMIZE Put the window into maximized state upon being managed. .It MINIMALBORDER diff --git a/spectrwm.c b/spectrwm.c index 0737202..9cecaa1 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -971,6 +971,7 @@ struct quirk { #define SWM_Q_MAXIMIZE (1 << 13)/* Maximize window when mapped. */ #define SWM_Q_BELOW (1 << 14)/* Put window below when mapped. */ #define SWM_Q_ICONIFY (1 << 15)/* Put window below when mapped. */ +#define SWM_Q_IGNOREURGENT (1 << 16)/* Ignore urgency hint. */ }; TAILQ_HEAD(quirk_list, quirk) quirks = TAILQ_HEAD_INITIALIZER(quirks); @@ -4115,8 +4116,9 @@ set_attention(struct ws_win *win) static bool win_urgent(struct ws_win *win) { - return (xcb_icccm_wm_hints_get_urgency(&win->hints) != 0 || - DEMANDS_ATTENTION(win)); + return (!(win->quirks & SWM_Q_IGNOREURGENT) && + (xcb_icccm_wm_hints_get_urgency(&win->hints) != 0 || + DEMANDS_ATTENTION(win))); } static void @@ -12808,6 +12810,7 @@ const char *quirkname[] = { "MAXIMIZE", "BELOW", "ICONIFY", + "IGNOREURGENT", }; /* SWM_Q_DELIM: retain '|' for back compat for now (2009-08-11) */