[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HLWM focusing on the wrong things!



Hi,

On Wed, Dec 12, 2012 at 08:32:20PM +0100, Hans-Peter Deifel wrote:
> Steps to reproduce:
> 
>  - Enable focus stealing prevention
>  - Create two frames (unrelated, just for better observability)
>  - Open a terminal in one
>  - Open emacs in the other one using
> 
>    emacs -Q --eval '(progn (sleep-for 2) (select-frame-set-input-focus
>      (car (frame-list))))'
> 
>  - Focus the terminal as soon as the emacs window appears
>  - Wait 2 seconds
>  - Type something
>
> What actually happens:
> 
>  The emacs window has the focus, but the terminal is the active window
>  (as indicated by it's border)

This actually is a misbehaviour (bug?) of emacs: Emacs doesn't only
request the window manager to set the focus but also manually sets the
focus by calling XSetInputFocus(). This can't be prevented by the window
manager and it directly resets the keyboard focus.

The emacs code[1] I found on github does that and it can't be disabled
by any configuration option. This is already known by the emacs list[2].

So this is not the focus-bug we are looking for :( -- if it still
exists in hlwm.

Regards,
Thorsten

[1] https://github.com/tovbinm/emacs-24-mac/blob/master/src/xfns.c#L3531
[2] http://lists.gnu.org/archive/html/bug-gnu-emacs/2008-08/msg00741.html
    (search for XSetInputFocus)