From 09aad9868725b2add264f189bf6255a54fe5aabc Mon Sep 17 00:00:00 2001
From: Doug Coleman <doug.coleman@gmail.com>
Date: Tue, 4 Dec 2007 18:16:15 -0600
Subject: [PATCH] Fix UI bug that puts mouse-captured objects in the datastack
 while walking code I don't understand why it does this, but removing the
 spurious call to release-capture in the raise-window word fixes the problem

---
 extra/ui/windows/windows.factor | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/extra/ui/windows/windows.factor b/extra/ui/windows/windows.factor
index 43b30d7a9f..3d95e281aa 100755
--- a/extra/ui/windows/windows.factor
+++ b/extra/ui/windows/windows.factor
@@ -257,14 +257,12 @@ M: windows-ui-backend (close-window)
 : prepare-mouse ( hWnd uMsg wParam lParam -- button coordinate world )
     nip >r mouse-event>gesture r> >lo-hi rot window ;
 
-: mouse-captured? ( -- ? )
-    mouse-captured get ;
-
 : set-capture ( hwnd -- )
     mouse-captured get [
         drop
     ] [
-        [ SetCapture drop ] keep mouse-captured set
+        [ SetCapture drop ] keep
+        mouse-captured set
     ] if ;
 
 : release-capture ( -- )
@@ -276,7 +274,7 @@ M: windows-ui-backend (close-window)
     prepare-mouse send-button-down ;
 
 : handle-wm-buttonup ( hWnd uMsg wParam lParam -- )
-    mouse-captured? [ release-capture ] when
+    mouse-captured get [ release-capture ] when
     prepare-mouse send-button-up ;
 
 : make-TRACKMOUSEEVENT ( hWnd -- alien )
@@ -434,7 +432,7 @@ M: windows-ui-backend flush-gl-context ( handle -- )
 ! Move window to front
 M: windows-ui-backend raise-window ( world -- )
     world-handle [
-        win-hWnd SetFocus drop release-capture
+        win-hWnd SetFocus drop
     ] when* ;
 
 M: windows-ui-backend set-title ( string world -- )