 : key-event>gesture ( event -- mods sym/f action? )
     GdkEventKey memory>struct
     [ event-modifiers ] [ key-sym ] bi ;
-
-: handle-key-gesture ( key-gesture world -- )
-    [ propagate-key-gesture ]
-    [ update-im-cursor-location ] bi ;
-   
+  
 : on-key-press ( sender event user-data -- result )
     drop swap [ key-event>gesture <key-down> ] [ window ] bi*
-    handle-key-gesture t ;
+    propagate-key-gesture t ;
 
 : on-key-release ( sender event user-data -- result )
     drop swap [ key-event>gesture <key-up> ] [ window ] bi*
-    handle-key-gesture t ;
+    propagate-key-gesture t ;
 
 : on-focus-in ( sender event user-data -- result )
     2drop window focus-world t ;

: mouse-event>gesture ( event -- modifiers button loc )
    [ event-modifiers ] [ button>> ] [ event-loc ] tri ;

: gadget-location ( gadget -- loc )
    [ loc>> ] [ parent>> [ gadget-location v+ ] when* ] bi ;

: focusable-editor ( world -- editor/f )
    focusable-child dup editor? [ drop f ] unless ;

: get-cursor-location ( editor -- GdkRectangle )
    [ [ gadget-location ] [ caret-loc ] bi v+ first2 ]
    [ line-height ] bi 0 swap GdkRectangle <struct-boa> ;

: update-im-cursor-location ( world -- )
    dup focusable-editor [
        [ handle>> im-context>> ] [ get-cursor-location ] bi*
        gtk_im_context_set_cursor_location
    ] [ drop ] if* ;

: on-motion ( sender event user-data -- result )
    drop swap
    [ GdkEventMotion memory>struct event-loc ] dip window

        f f gtk_gl_init
        init-clipboard
        start-ui
        stop-io-thread
        [
            init-io-event-source
            init-timeout
