[xmonad] darcs patch: Decoration: add a mouseEventHook methohd... (and 2 more)

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Fri Feb 8 10:43:09 EST 2008

On Feb 8, 2008, at 8:45 , Andrea Rossato wrote:

> On Fri, Feb 08, 2008 at 01:49:12PM +0100, Andrea Rossato wrote:
>>> One more thing: now, when I start dragging I do not calculate the
>>> distance between the mouse and the origin of the window, and so, at
>>> first, the window origin will abruptly change to reflect the mouse
>>> position. I know it's probably just a line of code but I didn't  
>>> write
>>> it so far...
>> should be easy (but my first attempt did not produce nice results:  
>> the
>> window jumped out of the screen... maybe something wrong with my
>> math...;)
> Maybe it is the easiest thing to do, maybe it is even impossible. Who
> knows... I do not and I think I'll leave to those guys, here, who have
> some memory of analytic geometry, because at the present time I'm
> quite confused on the matter...;)

Don't calculate. ButtonPress and ButtonRelease events include the  
(x,y) coordinates relative to the receiving window, which is the  
offset you want to keep as you drag.

brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH

More information about the xmonad mailing list