Just a quick follow up on this challenge I wrote about last week:

On Thu, 13 Sep 2012 13:47:34 +0200, Adam wrote:

>   DestroyFunc UrgencyFunc
>   AddToFunc UrgencyFunc
>    + I Iconify off

> This works, but has the drawback that the de-iconified window gains
> focus - which I do not want

After failing to find a way to detect whether the window that gets the
URGENT hint set already had focus (and then not doing the "switch focus
back to the previous window that had it"-trick), I looked at the source
code to see if I couldn't patch "Iconify off" to not focus the window.

In the DeIconify() function in icons.c there are two calls to
SetFocusWindow(). A little printf debugging revealed that the first is
called when I de-iconify using the mouse and the second is called when
Iconify off is called from my UrgencyFunc.

Also, the second call is only done if the focus style is
'SortWindowListByOpen'(ish). Aha!

So adding:

    FocusStyle * SortWindowListByFocus

to my configuration turns out to fix my problem (I don't use windowlists
so I don't care about that setting).

Sweet!


  Best regards,

    Adam

-- 
 "Hur långt man än har kommit                                 Adam Sjøgren
  Är det alltid längre kvar"                             a...@koldfront.dk


Reply via email to