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 problemrelease
parent
2b003568e5
commit
09aad98687
|
@ -257,14 +257,12 @@ M: windows-ui-backend (close-window)
|
||||||
: prepare-mouse ( hWnd uMsg wParam lParam -- button coordinate world )
|
: prepare-mouse ( hWnd uMsg wParam lParam -- button coordinate world )
|
||||||
nip >r mouse-event>gesture r> >lo-hi rot window ;
|
nip >r mouse-event>gesture r> >lo-hi rot window ;
|
||||||
|
|
||||||
: mouse-captured? ( -- ? )
|
|
||||||
mouse-captured get ;
|
|
||||||
|
|
||||||
: set-capture ( hwnd -- )
|
: set-capture ( hwnd -- )
|
||||||
mouse-captured get [
|
mouse-captured get [
|
||||||
drop
|
drop
|
||||||
] [
|
] [
|
||||||
[ SetCapture drop ] keep mouse-captured set
|
[ SetCapture drop ] keep
|
||||||
|
mouse-captured set
|
||||||
] if ;
|
] if ;
|
||||||
|
|
||||||
: release-capture ( -- )
|
: release-capture ( -- )
|
||||||
|
@ -276,7 +274,7 @@ M: windows-ui-backend (close-window)
|
||||||
prepare-mouse send-button-down ;
|
prepare-mouse send-button-down ;
|
||||||
|
|
||||||
: handle-wm-buttonup ( hWnd uMsg wParam lParam -- )
|
: handle-wm-buttonup ( hWnd uMsg wParam lParam -- )
|
||||||
mouse-captured? [ release-capture ] when
|
mouse-captured get [ release-capture ] when
|
||||||
prepare-mouse send-button-up ;
|
prepare-mouse send-button-up ;
|
||||||
|
|
||||||
: make-TRACKMOUSEEVENT ( hWnd -- alien )
|
: make-TRACKMOUSEEVENT ( hWnd -- alien )
|
||||||
|
@ -434,7 +432,7 @@ M: windows-ui-backend flush-gl-context ( handle -- )
|
||||||
! Move window to front
|
! Move window to front
|
||||||
M: windows-ui-backend raise-window ( world -- )
|
M: windows-ui-backend raise-window ( world -- )
|
||||||
world-handle [
|
world-handle [
|
||||||
win-hWnd SetFocus drop release-capture
|
win-hWnd SetFocus drop
|
||||||
] when* ;
|
] when* ;
|
||||||
|
|
||||||
M: windows-ui-backend set-title ( string world -- )
|
M: windows-ui-backend set-title ( string world -- )
|
||||||
|
|
Loading…
Reference in New Issue