Fix UI thread not waking up from input
This commit is contained in:
parent
20458de752
commit
bc0ddbb05a
|
@ -52,14 +52,9 @@ Win32Loop::~Win32Loop() {
|
||||||
|
|
||||||
void Win32Loop::ThreadMain() {
|
void Win32Loop::ThreadMain() {
|
||||||
MSG msg;
|
MSG msg;
|
||||||
while (!should_exit_) {
|
while (!should_exit_ && GetMessage(&msg, NULL, 0, 0)) {
|
||||||
DWORD result =
|
TranslateMessage(&msg);
|
||||||
MsgWaitForMultipleObjectsEx(0, nullptr, INFINITE, QS_ALLINPUT, 0);
|
DispatchMessage(&msg);
|
||||||
|
|
||||||
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
|
|
||||||
TranslateMessage(&msg);
|
|
||||||
DispatchMessage(&msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Process queued functions.
|
// Process queued functions.
|
||||||
std::lock_guard<std::mutex> lock(posted_functions_mutex_);
|
std::lock_guard<std::mutex> lock(posted_functions_mutex_);
|
||||||
|
|
Loading…
Reference in New Issue