[xmonad] Patch: fix focus when user is moving the mouse

Klaus Weidner kweidner at pobox.com
Wed Apr 9 19:25:22 EDT 2008

Spencer Janssen <sjanssen at cse.unl.edu> wrote:
> First, a minor nitpick: if you want this patch to be applied, please change all
> identifiers to camelCase for consistency with the rest of xmonad.

Sorry about that, I'll fix it. Is it okay to use "darcs unrecord" and
redo the patch, or should it be incremental?

> I foresee some problems with this patch.  Consider the following sequence of
> events, starting from an empty workspace in the Tall layout:
>  - increment nmaster to three
>  - create three xterms
>  - focus the second window with the mouse.  At this time mouse_focus
>    will be set to True
>  - position the mouse such that it occupies the upper half of the second window
>  - close the second window without using an xmonad keybinding (typing 'exit' in
>    an xterm will suffice)
>  - the windows will shuffle about, and xmonad will set focus to the last window
>    as usual.  Also, the first window will now be under the mouse pointer, and
>    an entry event will be generated.
> In the old system, this entry event is removed and all is well.  With your
> proposed changes the entry event will not be removed, and focus will be changed
> to the first window -- not good!

This wouldn't bother me personally, but I understand the rationale that
you had explained to Justin.

Would it be sufficient to simply clear the mouseFocused flag in the event
handlers for MapRequest/DestroyWindow/Unmap, so that any changes to the
window list that are outside of the control of xmonad preserve the
original behavior?


More information about the xmonad mailing list