try not to render to factor windows when they're minimized

db4
Doug Coleman 2008-04-10 21:17:23 -05:00
parent d28212efe3
commit 2cefe124d6
1 changed files with 12 additions and 2 deletions

View File

@ -7,7 +7,7 @@ vectors words windows.kernel32 windows.gdi32 windows.user32
windows.opengl32 windows.messages windows.types windows.nt
windows threads libc combinators continuations command-line
shuffle opengl ui.render unicode.case ascii math.bitfields
locals symbols ;
locals symbols accessors ;
IN: ui.windows
SINGLETON: windows-ui-backend
@ -203,8 +203,18 @@ SYMBOLS: msg-obj class-name-ptr mouse-captured ;
wParam keystroke>gesture <key-up>
hWnd window-focus send-gesture drop ;
: set-window-active ( hwnd uMsg wParam lParam ? -- n )
>r 4dup r> 2nip nip
swap window set-world-active? DefWindowProc ;
: handle-wm-syscommand ( hWnd uMsg wParam lParam -- n )
dup alpha? [ 4drop 0 ] [ DefWindowProc ] if ;
{
{ [ over SC_MINIMIZE = ] [ f set-window-active ] }
{ [ over SC_RESTORE = ] [ t set-window-active ] }
{ [ over SC_MAXIMIZE = ] [ t set-window-active ] }
{ [ dup alpha? ] [ 4drop 0 ] }
{ [ t ] [ DefWindowProc ] }
} cond ;
: cleanup-window ( handle -- )
dup win-title [ free ] when*