 : 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 ;

! Copyright (C) 2010 Anton Gorenko, Philipp Brüschweiler.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien.accessors alien.c-types alien.data
alien.enums alien.strings arrays ascii assocs classes.struct
combinators combinators.short-circuit command-line destructors
documents gdk.ffi gdk.gl.ffi glib.ffi gobject.ffi gtk.ffi
gtk.gl.ffi io.backend.unix.multiplexers io.encodings.utf8
io.thread kernel libc literals locals math math.bitwise
math.order math.vectors namespaces sequences strings system
threads ui ui.backend ui.clipboards ui.event-loop ui.gadgets
ui.gadgets.editors ui.gadgets.line-support ui.gadgets.private
ui.gadgets.worlds ui.gestures ui.pixel-formats
ui.pixel-formats.private ui.private ;
RENAME: windows ui.private => ui:windows
IN: ui.backend.gtk

SINGLETON: gtk-ui-backend

TUPLE: handle ;
TUPLE: window-handle < handle window fullscreen? im-context ;

: <window-handle> ( window im-context -- window-handle )
    window-handle new

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