 M: world leave-event 2drop forget-rollover ;
 
 M: world motion-event
-    [ dup XMotionEvent-x swap XMotionEvent-y 2array ] dip
+    [ [ XMotionEvent-x ] [ XMotionEvent-y ] bi 2array ] dip
     move-hand fire-motion ;
 
 M: world focus-in-event

    } at ;

M: world wheel-event
    [ dup mouse-event>scroll-direction swap mouse-event-loc ] dip
    send-wheel ;

M: world enter-event motion-event ;


: clipboard-for-atom ( atom -- clipboard )
    {
        { XA_PRIMARY [ selection get ] }
        { XA_CLIPBOARD [ clipboard get ] }
        [ drop <clipboard> ]
    } case ;

: encode-clipboard ( string type -- bytes )
    XSelectionRequestEvent-target
