Skip to content

Commit

Permalink
Stop swallowing WM_NCACTIVATE when borderless override is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaldaien committed Aug 15, 2023
1 parent a9dce08 commit c1a3ab5
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,9 @@ ActivateWindow ( HWND hWnd,
BYTE newKeyboardState [256] = { };
SetKeyboardState (newKeyboardState);

if (hWndFocus != game_window.hWnd && (is_game_window && game_window.active))
if ( hWndFocus != 0 &&
hWndFocus != game_window.hWnd &&
(is_game_window && game_window.active) )
{
BringWindowToTop (hWndFocus);
SetForegroundWindow (hWndFocus);
Expand Down Expand Up @@ -5547,12 +5549,6 @@ SK_DetourWindowProc ( _In_ HWND hWnd,
case WM_ACTIVATE:
case WM_NCACTIVATE:
{
if (uMsg == WM_NCACTIVATE && config.window.borderless)
{
return
DefWindowProcW (hWnd, uMsg, wParam, -1);
}

if ( uMsg == WM_NCACTIVATE ||
uMsg == WM_ACTIVATEAPP )
{
Expand Down Expand Up @@ -5712,10 +5708,7 @@ SK_DetourWindowProc ( _In_ HWND hWnd,
if (wParam == TRUE)
{
if ( config.window.borderless ||
rb.fullscreen_exclusive )
{
return 0;
}
rb.fullscreen_exclusive ) return 0;
}
break;

Expand Down

0 comments on commit c1a3ab5

Please sign in to comment.