[xmonad] darcs patch: quick hack to avoid infinite (but breakable) loop when...

Spencer Janssen sjanssen at cse.unl.edu
Sat May 17 15:54:52 EDT 2008


On Sat, May 17, 2008 at 12:13:00PM -0700, Klaus Weidner wrote:
> On Sat, May 17, 2008 at 01:38:48PM -0500, Spencer Janssen wrote:
> > On Sat, May 17, 2008 at 05:09:41AM -0700, David Roundy wrote:
> > > On Sat, May 17, 2008 at 03:12:49AM -0700, Klaus Weidner wrote:
> > > > Probably the right thing to do would be to clear the pending crossing
> > > > events in 'windows' whenever the layout manipulation moves/resizes/remaps
> > > > windows, and not clear it if only the focus has changed. What would be
> > > > a clean way to make that distinction?
> > > 
> > > Probably a better option would be to not clear crossing events at all, but
> > > instead when we handle crossing events to first check if the mouse is still
> > > in the said window.  If it's not, then we should ignore the event.
> > 
> > This misses the entire reason why we clear window entry events in the first
> > place.  When the current layout changes (or when switching workspaces) a window
> > entry event will be generated for the window under the cursor even if the mouse
> > is entirely stationary.  We don't want to perform focus changes based on the
> > position of the mouse if the user isn't even moving it.
> 
> So would the right thing be to do a combination of both? Keep the current
> mouseFocused logic in Operations.hs to discard crossing events if the
> user wasn't moving the mouse, and add the check in Main.hs to skip the
> focusing on Enter events if the pointer isn't in the window being entered
> anymore?
> 
> -Klaus

Maybe this will work.  Though I worry about race conditions -- remember that
X11 is an asynchronous protocol.


More information about the xmonad mailing list