[Xmonad] getting rid of CrossingEvent

Andrea Rossato mailing_list at istitutocolli.org
Mon Aug 20 12:18:01 EDT 2007

On Mon, Aug 20, 2007 at 11:22:17AM -0400, David Roundy wrote:
> On Sat, Aug 18, 2007 at 03:50:48PM +0200, Andrea Rossato wrote:
> > The present behavior is incompatible with Tabbed (it forces a redraw
> > of tabs every time the pointer enters a window). Moreover I don't like
> > very much the fact that a keyboard driven WM gives such a power to the
> > mice.
> Actually, the present behavior works as it is supposed to with Tabbed:
> when focus changes, we *need* to redraw the tabs, so they will properly
> reflect the focus.

Sorry, I didn't mean this: what I meant is that mouse focus forces
tabs to be redrawn whenever the pointer enters the focused windows
coming from tabs (you've just sent a patch to correct that if I read
> I like the idea of xmonad as a user-driven WM...

I was just kidding when talking about mice's power...;-) 

If your patch will make mouse focus a bit less noticeable, I can live
with it.
> > I need it for my remote controlling stuff. But I'm not the only one.
> I think I can see this:  you want to insert hooks that are not part of a
> Layout?

That's it.

> > Indeed the same problem can be seen with SwitchTrans.hs (Lukas decided
> > not to let David do the nice stuff he does with modifyLayout ...;-).
> > This is also the reason why XMonadContrib.LayoutHelpers.idModMod is
> > not a real identity, like erasing something is not anything anymore.
> > 
> > We are hitting this problem frequently...
> This is quite a different issue.  The issue here is just that Lukas has
> chosen not to properly support either self-modifying layouts or
> self-modifying transformers.  I don't think this is because it couldn't be
> supported, but rather because he wrote what I would call buggy code (just
> see how often he ignores the return value of modifyLayout).  It's
> unfortunate that it's so easy to do so, but I haven't come up with a
> framework that is more bulletproof.

I'm quite aware that I seem not to get something about layout
modifiers. I thought that adding a hook was just like:

layoutModifier :: Layout a -> Layout a
layoutModifier  cl@(Layout {doLayout = dl , modifyLayout = ml}) = 
    Layout {doLayout = dl , modifyLayout = modLay}
    where modLay sm | Just e <- fromMessage sm = do
                                 handle_event e
                                 ml sm
                   | otherwise = ml sm
          handle_event e@(AnyEvent {ev_event_type = t})
              | t == whatEverEvent = do io (putStrLn "Hello World") >> return () -- but focus w ???
          handle_event _ = return ()

But if I change "putStrLn Hello..." with focus w, that is to say, if I
change the stack of windows what should I do next? runlayout (with the
need of recalculating the screen rectangle), for instance? 

This is not clear to me and I seem not to be able to get it only by
studying the code (your code actually). Self-modifying layouts and
layout transformers is precisely what I want to understand. Can you
give me some directions, please?

Thanks for your kind attention,

More information about the Xmonad mailing list