: window ( handle -- world ) ui-windows get-global at ;
: register-window ( world handle -- )
- #! Add the new window just below the topmost window. Why?
- #! So that if the new window doesn't actually receive focus
- #! (eg, we're using focus follows mouse and the mouse is not
- #! in the new window when it appears) Factor doesn't get
- #! confused and send workspace operations to the new window,
- #! etc.
+ ! Add the new window just below the topmost window. Why?
+ ! So that if the new window doesn't actually receive focus
+ ! (eg, we're using focus follows mouse and the mouse is not
+ ! in the new window when it appears) Factor doesn't get
+ ! confused and send workspace operations to the new window,
+ ! etc.
swap 2array ui-windows get-global push
ui-windows get-global dup length 1 >
[ [ length 1 - dup 1 - ] keep exchange ] [ drop ] if ;
<PRIVATE
: update-ui-loop ( -- )
- #! Note the logic: if update-ui fails, we open an error window
- #! and run one iteration of update-ui. If that also fails, well,
- #! the whole UI subsystem is broken so we exit out of the
- #! update-ui-loop.
+ ! Note the logic: if update-ui fails, we open an error window
+ ! and run one iteration of update-ui. If that also fails, well,
+ ! the whole UI subsystem is broken so we exit out of the
+ ! update-ui-loop.
[ { [ ui-running? ] [ ui-thread get-global self eq? ] } 0&& ]
[
ui-notify-flag get lower-flag