Re: [dwm] focus steeling bugfix

From: Anselm R. Garbe <arg_AT_suckless.org>
Date: Sun, 18 Nov 2007 09:47:58 +0100

On Sat, Nov 17, 2007 at 04:47:42PM -0500, Jeremy O'Brien wrote:
> On Sat, Nov 17, 2007 at 08:10:22PM +0100, Anselm R. Garbe wrote:
> > Hi there,
> >
> > I believe I fixed the bug of focus steeling X clients, like when
> > running opera in an unvisible tag and doing
> >
> > opera -newpage www.google.de
> >
> > Please recheck hg tip accordingly.
> >
> > During last week I pushed a potential fix of the XToolkit
> > problem caused by the XWM implementation of the XToolkit in JDK
> > 1.5+. Actually my idea was, that dwm sets all necessary EWMH
> > hints to tell JDK that it is compiz or LG3D (Looking Glass)
> > resp. But it didn't worked. I rechecked with compiz and
> > found out, that those Java apps I tried don't behave differently
> > to dwm at least with compiz 0.3.6. So I postponed another try
> > for maybe next year. But if Sun begins to hardcode specific
> > window manager support, it might be worth to hack it with the
> > same weapons.
> >
> > Regards,
> > --
> > Anselm R. Garbe >< http://www.suckless.org/ >< GPG key: 0D73F361
> >
>
> Never thought I'd see the day when pidgin wouldn't steal focus.
> Excellent work. I think I can actually see when pidgin tries to take
> over, because my terminal flashes for a fraction of a second. Very
> interesting.

According to ICCCM there are 4 kinds of focus handling for
clients:

- a client never requests the input focus and sets a hint that
it never needs the input focus (eg xload)

- a client never requests the input focus, but handles input if
it gets the input focus in default X focus follows mouse mode or
from the window manager if such thing is present (most X
                clients, eg xterm)

- a client requests the input focus on its own, but only if some
parent window of this client already owns the focus (eg some
popup dialogs behave that way)

- a client requests the input focus on its own, regardless which
client owns the input focus atm (eg opera -newpage)

All these focus acquiring methods are valid and ICCCM compliant
(to my surprise). However, dwm enforces now its design decision
that dwm is the master about focus handling, and not a random
client of the last category.

As you might imagine, there is no way to prevent the flashing,
because those clients listen for a FocusIn event and calm down
afterwards only. Hence dwm accepts that they focus for
themselves, but reverts to dwm's focussing state afterwards.

Regards,

-- 
 Anselm R. Garbe >< http://www.suckless.org/ >< GPG key: 0D73F361
Received on Sun Nov 18 2007 - 09:47:58 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:06:54 UTC