 
 :: on-button-press ( win event user-data -- ? )
     win window :> world
-    event mouse-event>gesture :> ( modifiers button loc )
-    button {
-        { 8 [ ] }
-        { 9 [ ] }
-        [ modifiers swap <button-down> loc world
-          send-button-down ]
-    } case t ;
+    event type>> GDK_BUTTON_PRESS = [
+        event button>> {
+            { 8 [ ] }
+            { 9 [ ] }
+            [
+                event event-modifiers swap <button-down>
+                event event-loc
+                world
+                send-button-down
+            ]
+        } case
+    ] when t ;
 
 :: on-button-release ( win event user-data -- ? )
     win window :> world
-    event mouse-event>gesture :> ( modifiers button loc )
-    button {
-        { 8 [ world left-action send-action ] }
-        { 9 [ world right-action send-action ] }
-        [ modifiers swap <button-up> loc world
-          send-button-up ]
-    } case t ;
+    event type>> GDK_BUTTON_RELEASE = [
+        event button>> {
+            { 8 [ world left-action send-action ] }
+            { 9 [ world right-action send-action ] }
+            [
+                event event-modifiers swap <button-up>
+                event event-loc
+                world
+                send-button-up
+            ]
+        } case
+    ] when t ;
 
 : on-scroll ( win event user-data -- ? )
     drop swap [

        { normal-title-bar $ GDK_DECOR_TITLE }
        { textured-background 0 }
    }
    
CONSTANT: window-controls>func-flags
    H{
        { close-button $ GDK_FUNC_CLOSE }

        { $ GDK_SCROLL_RIGHT { 1 0 } }
    } at ;

: on-motion ( win event user-data -- ? )
    drop swap
    [ event-loc ] dip window
