From ece98fdad63e4bd76857548f81c1e6ca395e15ce Mon Sep 17 00:00:00 2001 From: slava Date: Wed, 31 May 2006 07:26:59 +0000 Subject: [PATCH] Update hand gadget on relayout --- library/ui/ui.factor | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/library/ui/ui.factor b/library/ui/ui.factor index 1ca1a36c3d..4f76566a02 100644 --- a/library/ui/ui.factor +++ b/library/ui/ui.factor @@ -24,13 +24,18 @@ SYMBOL: windows windows get-global [ second eq? ] find-with drop windows get-global [ length 1- ] keep exchange ; +: update-hand ( world -- ) + dup hand-gadget get-global find-world eq? + [ hand-loc get-global swap move-hand ] [ drop ] if ; + +: post-layout ( gadget -- ) + find-world [ dup update-hand dup world-handle set ] when* ; + : layout-queued ( -- ) invalid dup queue-empty? [ drop ] [ - deque dup layout - find-world [ dup world-handle set ] when* - layout-queued + deque dup layout post-layout layout-queued ] if ; : init-ui ( -- )