[xmonad] Ratpoison style focus

adam vogt vogt.adam at gmail.com
Fri May 14 13:32:33 EDT 2010


On Fri, May 14, 2010 at 8:18 AM, Ivan Lazar Miljenovic
<ivan.miljenovic at gmail.com> wrote:
> Davi Reis <davi.reis at gmail.com> writes:
>
>> Hi Wagner, Ivan,
>>
>> Thanks for the answers, but none of these are what I am looking for.
>> Ratpoison was unique in this regard, so it is a bit hard to understand
>> the behavior without seeing it. Here is an example:
>>
>> Suppose I have two windows in a single workspace, both visible at the
>> same time (e.g., vertical tiled). One of them is xterm and the other
>> is firefox. My focus is on xterm and I am typing something. Then I
>> decide to click a link on the browser. When I start to type again, I
>> want the keys to go directly to xterm, without needing to move the
>> mouse to give xterm the focus, or using some shortcut (e.g., mod+j) to
>> move the focus back to xterm.
>>
>> In other words, I want mouse actions to have no influence on the
>> focus. Pretty much the opposite of focus-follow-mouse (when you use
>> the mouse) and pointer-follows-focus (when you use the keyboard).
>
> Well, you can disable focus-follows-mouse... but I think clicking with
> it might set the focus (not too sure about this).
>
> Completely removing the mouse pointer from the equation of focus might
> be possible, but I don't know enough of XMonad's details to be able to
> answer this definitively.
>

Here are some ideas for getting xmonad to focus as you describe:

I don't know if you can implement what you want outside of modifying
xmonad's core, but I would try to use the handleEventHook to intercept
those specific mouse clicks be used to stop xmonad from responding to
mouse clicks in unfocused windows. When the event matches your
specific focus case, return (All False).

If that doesn't work out, and you must modify the core of xmonad, it
might be helpful to look at what this patch does, as it results in
mouse an d keyboard focus being different in a specific case:

http://code.google.com/p/xmonad/issues/detail?id=177#c33

--
Adam


More information about the xmonad mailing list