Skip to content

Commit

Permalink
Don't send WM_ACTIVATE
Browse files Browse the repository at this point in the history
  • Loading branch information
elishacloud committed Sep 12, 2023
1 parent e7a37a6 commit 6aa826a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Dllmain/BuildNo.rc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define BUILD_NUMBER 6810
#define BUILD_NUMBER 6811
17 changes: 6 additions & 11 deletions ddraw/IDirectDrawX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2948,20 +2948,15 @@ HRESULT m_IDirectDrawX::CreateD3D9Device()
if (NewRect.left != LastRect.left || NewRect.top != LastRect.top || NewRect.right != LastRect.right || NewRect.bottom != LastRect.bottom)
{
SendMessage(hWnd, WM_WINDOWPOSCHANGING, 0, (LPARAM)&winpos);
if (NewRect.left != LastRect.left || NewRect.top != LastRect.top)
{
SendMessage(hWnd, WM_MOVE, 0, MAKELPARAM(NewRect.left, NewRect.top));
}
if (NewRect.right - NewRect.left != LastRect.right - LastRect.left || NewRect.bottom - NewRect.top != LastRect.bottom - LastRect.top)
{
SendMessage(hWnd, WM_SIZE, SIZE_RESTORED, MAKELPARAM(NewRect.right - NewRect.left, NewRect.bottom - NewRect.top));
}
SendMessage(hWnd, WM_WINDOWPOSCHANGED, 0, (LPARAM)&winpos);
}
if (GetActiveWindow() == hWnd)
if (NewRect.left != LastRect.left || NewRect.top != LastRect.top)
{
SendMessage(hWnd, WM_MOVE, 0, MAKELPARAM(NewRect.left, NewRect.top));
}
if (NewRect.right - NewRect.left != LastRect.right - LastRect.left || NewRect.bottom - NewRect.top != LastRect.bottom - LastRect.top)
{
SendMessage(hWnd, WM_ACTIVATE, MAKEWPARAM(WA_ACTIVE, WM_NULL), (LPARAM)hWnd);
SendMessage(hWnd, WM_SETFOCUS, WM_NULL, 0);
SendMessage(hWnd, WM_SIZE, SIZE_RESTORED, MAKELPARAM(NewRect.right - NewRect.left, NewRect.bottom - NewRect.top));
}

// Peek messages to help prevent a "Not Responding" window
Expand Down

0 comments on commit 6aa826a

Please sign in to comment.