diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2016-07-03 19:17:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-03 19:17:09 +0200 |
commit | 6bd22b9c2ebe8a7c489e167d61961be5ee210923 (patch) | |
tree | 3f4dc8b9f3faeaf897e0387ed77d61d24282bcb4 /platform/windows | |
parent | e0c7ffc65aa17b626e04949a5bf63bda51da595c (diff) | |
parent | 6856c5249104d2b69fe297ff7546092e3bb23555 (diff) |
Merge pull request #5516 from Hinsbart/fix_win_freeze
Windows: prevent freeze while moving or resizing the game window.
Diffstat (limited to 'platform/windows')
-rw-r--r-- | platform/windows/os_windows.cpp | 16 | ||||
-rw-r--r-- | platform/windows/os_windows.h | 2 |
2 files changed, 17 insertions, 1 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 9421e0d48e..89de969cff 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -612,6 +612,20 @@ LRESULT OS_Windows::WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam) { } //return 0; // Jump Back } break; + + case WM_ENTERSIZEMOVE: { + move_timer_id = SetTimer(hWnd, 1, USER_TIMER_MINIMUM,(TIMERPROC) NULL); + } break; + case WM_EXITSIZEMOVE: { + KillTimer(hWnd, move_timer_id); + } break; + case WM_TIMER: { + if (wParam == move_timer_id) { + process_key_events(); + Main::iteration(); + } + } break; + case WM_SYSKEYDOWN: case WM_SYSKEYUP: case WM_KEYUP: @@ -1140,7 +1154,7 @@ void OS_Windows::initialize(const VideoMode& p_desired,int p_video_driver,int p_ DragAcceptFiles(hWnd,true); - + move_timer_id = 1; } void OS_Windows::set_clipboard(const String& p_text) { diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index 509d76abbf..d2249bf352 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -104,6 +104,8 @@ class OS_Windows : public OS { HINSTANCE hInstance; // Holds The Instance Of The Application HWND hWnd; + uint32_t move_timer_id; + HCURSOR hCursor; Size2 window_rect; |