From 7570b189cfe9ddbc7e4cd79cf4a19bff2d30830b Mon Sep 17 00:00:00 2001 From: slava Date: Wed, 22 Mar 2006 07:39:36 +0000 Subject: [PATCH] Bootstrap fix, stop event loop after all windows closed, start UI by default if $DISPLAY is set --- library/x11/events.factor | 6 ++++-- library/x11/load.factor | 2 +- library/x11/ui.factor | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/library/x11/events.factor b/library/x11/events.factor index 750d104959..ac042e06a4 100644 --- a/library/x11/events.factor +++ b/library/x11/events.factor @@ -46,8 +46,10 @@ GENERIC: client-event ( event window -- ) } cond ; : event-loop ( -- ) - wait-event dup XAnyEvent-window windows get hash dup - [ handle-event ] [ 2drop ] if event-loop ; + windows get hash-empty? [ + wait-event dup XAnyEvent-window windows get hash dup + [ handle-event ] [ 2drop ] if event-loop + ] unless ; : char-array>string ( n -- string ) swap >string [ swap char-nth ] map-with ; diff --git a/library/x11/load.factor b/library/x11/load.factor index 388ed46a16..fdb040e217 100644 --- a/library/x11/load.factor +++ b/library/x11/load.factor @@ -8,8 +8,8 @@ USING: kernel parser words compiler sequences ; "/library/x11/constants.factor" "/library/x11/utilities.factor" "/library/x11/events.factor" - "/library/x11/windows.factor" "/library/x11/glx-utils.factor" + "/library/x11/windows.factor" "/library/x11/ui.factor" } [ run-resource ] each diff --git a/library/x11/ui.factor b/library/x11/ui.factor index 20a2445ab4..0b068a5c9e 100644 --- a/library/x11/ui.factor +++ b/library/x11/ui.factor @@ -121,4 +121,4 @@ IN: shells IN: kernel -! : default-shell "DISPLAY" os-env empty? "tty" "ui" ? ; +: default-shell "DISPLAY" os-env empty? "tty" "ui" ? ;