Add awaken-event-loop word

db4
Slava Pestov 2009-04-18 02:19:49 -05:00
parent 4f74810c15
commit 0a22476cd3
2 changed files with 10 additions and 2 deletions

View File

@ -1,6 +1,7 @@
! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: io.backend.unix namespaces system x11 x11.xlib ;
USING: io.backend.unix io.backend.unix.multiplexers
namespaces system x11 x11.xlib accessors threads sequences ;
IN: x11.unix
SYMBOL: dpy-fd
@ -8,3 +9,6 @@ SYMBOL: dpy-fd
M: unix init-x-io dpy get XConnectionNumber <fd> dpy-fd set-global ;
M: unix wait-for-display dpy-fd get +input+ wait-for-fd ;
M: unix awaken-event-loop
dpy-fd get fd>> mx get remove-input-callbacks [ resume ] each ;

View File

@ -28,6 +28,10 @@ HOOK: wait-for-display io-backend ( -- )
M: object wait-for-display 10 milliseconds sleep ;
HOOK: awaken-event-loop io-backend ( -- )
M: object awaken-event-loop ;
: init-x ( display-string -- )
init-locale
dup [ ascii string>alien ] when