Skip to content

Commit

Permalink
Always send messages after device creation
Browse files Browse the repository at this point in the history
  • Loading branch information
elishacloud committed Sep 13, 2023
1 parent 97b1c09 commit 1dcaecc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 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 6813
#define BUILD_NUMBER 6814
17 changes: 4 additions & 13 deletions ddraw/IDirectDrawX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2949,19 +2949,10 @@ HRESULT m_IDirectDrawX::CreateD3D9Device()
static WINDOWPOS winpos;
HWND WindowInsert = GetWindowLong(DisplayMode.hWnd, GWL_EXSTYLE) & WS_EX_TOPMOST ? HWND_TOPMOST : HWND_TOP;
winpos = { hWnd, WindowInsert, NewRect.left, NewRect.top, NewRect.right - NewRect.left, NewRect.bottom - NewRect.top, WM_NULL };
if (NewRect.left != LastRect.left || NewRect.top != LastRect.top || NewRect.right != LastRect.right || NewRect.bottom != LastRect.bottom)
{
SendMessage(hWnd, WM_WINDOWPOSCHANGING, 0, (LPARAM)&winpos);
SendMessage(hWnd, WM_WINDOWPOSCHANGED, 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_WINDOWPOSCHANGING, 0, (LPARAM)&winpos);
SendMessage(hWnd, WM_WINDOWPOSCHANGED, 0, (LPARAM)&winpos);
SendMessage(hWnd, WM_MOVE, 0, MAKELPARAM(NewRect.left, NewRect.top));
SendMessage(hWnd, WM_SIZE, SIZE_RESTORED, MAKELPARAM(NewRect.right - NewRect.left, NewRect.bottom - NewRect.top));

// Peek messages to help prevent a "Not Responding" window
Utils::CheckMessageQueue(hWnd);
Expand Down

0 comments on commit 1dcaecc

Please sign in to comment.