From 8717e745a89a412bee72defce835fd62bc7b719a Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 21 Jul 2013 02:21:50 -0700 Subject: [PATCH] Call SetCursor always on the UI thread. Fixes #2862. --- Windows/WndMainWindow.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Windows/WndMainWindow.cpp b/Windows/WndMainWindow.cpp index 6654d7ca88..88e6ee57fa 100644 --- a/Windows/WndMainWindow.cpp +++ b/Windows/WndMainWindow.cpp @@ -88,6 +88,8 @@ namespace MainWindow LRESULT CALLBACK DisplayProc(HWND, UINT, WPARAM, LPARAM); LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM); + const UINT WM_USER_SAVESTATE_FINISH = WM_USER + 100; + HWND GetHWND() { return hwndMain; } @@ -1001,6 +1003,9 @@ namespace MainWindow SetForegroundWindow(hwndMain); break; + case WM_USER_SAVESTATE_FINISH: + SetCursor(LoadCursor(0, IDC_ARROW)); + break; case WM_MENUSELECT: // Unfortunately, accelerate keys (hotkeys) shares the same enabled/disabled states @@ -1241,7 +1246,7 @@ namespace MainWindow void SaveStateActionFinished(bool result, void *userdata) { - SetCursor(LoadCursor(0, IDC_ARROW)); + PostMessage(hwndMain, WM_USER_SAVESTATE_FINISH, 0, 0); } HINSTANCE GetHInstance()