Add awaken-event-loop word
							parent
							
								
									4f74810c15
								
							
						
					
					
						commit
						0a22476cd3
					
				| 
						 | 
				
			
			@ -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 ;
 | 
			
		||||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue