Commit a8fd13a7 authored by chili's avatar chili
Browse files

better handling of activate/deactivate window

parent 11512ff4
...@@ -254,11 +254,13 @@ LRESULT Window::HandleMsg( HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam ) noex ...@@ -254,11 +254,13 @@ LRESULT Window::HandleMsg( HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam ) noex
{ {
OutputDebugString( "activeate => confine\n" ); OutputDebugString( "activeate => confine\n" );
ConfineCursor(); ConfineCursor();
HideCursor();
} }
else else
{ {
OutputDebugString( "activeate => free\n" ); OutputDebugString( "activeate => free\n" );
FreeCursor(); FreeCursor();
ShowCursor();
} }
} }
break; break;
...@@ -345,6 +347,12 @@ LRESULT Window::HandleMsg( HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam ) noex ...@@ -345,6 +347,12 @@ LRESULT Window::HandleMsg( HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam ) noex
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
{ {
SetForegroundWindow( hWnd ); SetForegroundWindow( hWnd );
if( !cursorEnabled )
{
OutputDebugString( "lclick => recapture\n" );
ConfineCursor();
HideCursor();
}
// stifle this mouse message if imgui wants to capture // stifle this mouse message if imgui wants to capture
if( imio.WantCaptureMouse ) if( imio.WantCaptureMouse )
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment