 
 M: x11-ui-backend (open-window) ( world -- )
     dup gadget-window
-    handle>> x11-handle-window dup set-closable map-window ;
+    handle>> window>> dup set-closable map-window ;
 
 M: x11-ui-backend raise-window* ( world -- )
     handle>> [
-        dpy get swap x11-handle-window XRaiseWindow drop
+        dpy get swap window>> XRaiseWindow drop
     ] when* ;
 
 M: x11-ui-backend select-gl-context ( handle -- )
     dpy get swap
-    dup x11-handle-window swap x11-handle-glx glXMakeCurrent
+    dup window>> swap glx>> glXMakeCurrent
     [ "Failed to set current GLX context" throw ] unless ;
 
 M: x11-ui-backend flush-gl-context ( handle -- )
-    dpy get swap x11-handle-window glXSwapBuffers ;
+    dpy get swap window>> glXSwapBuffers ;
 
 M: x11-ui-backend ui ( -- )
     [

: gadget-window ( world -- )
    dup window-loc>> over rect-dim glx-window
    over "Factor" create-xic <x11-handle>
    2dup x11-handle-window register-window
    swap (>>handle) ;

: wait-event ( -- event )

    } cond ;

M: x11-ui-backend (close-window) ( handle -- )
    dup xic>> XDestroyIC
    dup glx>> destroy-glx
    window>> dup unregister-window
    destroy-window ;

M: world client-event
