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

Klaus Weidner kweidner at pobox.com
Thu Apr 10 00:03:38 EDT 2008

On Wed, Apr 09, 2008 at 09:42:38PM -0500, Klaus Weidner wrote:
> I've attached an updated patch with the flag camelCased and additional
> logic to ensure that the behavior stays mouse position independent when
> adding or removing windows.
> Please let me know if there's a better way to do this. I'm not sure if
> there'd be a good place to clear the flag on relevant events without
> needing to put code into the individual handlers.

Yet another attempt - instead of modifying the event handlers, add a flag
argument to the "windows" function which is true when called from
"focus". This keeps the changes much smaller, and also correctly handles
added/deleted windows without needing to keep track of the mouse focus

To avoid adding a "False" extra argument to all other occurences of
"windows" (which are a lot), I've used a wrapper function to abstract
that out and provide a "windows" function which works like the original

For the xmonad core, it wouldn't be necessary to keep the state flag, but
it's still needed for UpdatePointer which otherwise gets confused and
starts focusing the wrong windows when the pointer is rapidly moved
across many windows.

Sorry about the many patches, I'm still trying to get the hang of this.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: xmonad-core-mouse-focused.dpatch
Type: text/x-darcs-patch
Size: 3464 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/xmonad/attachments/20080409/93182e36/xmonad-core-mouse-focused.bin

More information about the xmonad mailing list