diff --git a/src/platforms/rcore_desktop_win32.c b/src/platforms/rcore_desktop_win32.c index f24f51e41..285a8beb6 100644 --- a/src/platforms/rcore_desktop_win32.c +++ b/src/platforms/rcore_desktop_win32.c @@ -1439,6 +1439,11 @@ void SwapScreenBuffer(void) LogFail("SwapBuffers", GetLastError()); abort(); } + + if (!ValidateRect(global_hwnd, NULL)) { + LogFail("ValidateRect", GetLastError()); + abort(); + } } double GetTime(void) @@ -1551,6 +1556,8 @@ void PollInputEvents(void) MSG msg; while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE)) { + if (msg.message == WM_PAINT) + return; TranslateMessage(&msg); DispatchMessageW(&msg); } @@ -1778,12 +1785,6 @@ static LRESULT WndProc2(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, Flags } return 0; } - case WM_PAINT: { - PAINTSTRUCT ps; - BeginPaint(hwnd, &ps); - EndPaint(hwnd, &ps); - return 0; - } case WM_SETCURSOR: if (LOWORD(lparam) == HTCLIENT) { SetCursor(CORE.Input.Mouse.cursorHidden ? NULL : LoadCursorW(NULL, IDC_ARROW));