Skip to content

Commit

Permalink
WindowFilter: Fix deadlock in WndProc
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Oct 26, 2023
1 parent 77c8d90 commit 4103c2b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Framework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,8 @@ bool Framework::on_message(HWND wnd, UINT message, WPARAM w_param, LPARAM l_para
return true;
}

if (!WindowFilter::get().is_filtered(wnd)) {
// If we called is_filtered during a WM_GETTEXT message we would deadlock.
if (message != WM_GETTEXT && !WindowFilter::get().is_filtered(wnd)) {
m_uevr_shared_memory->data().main_thread_id = GetCurrentThreadId();
}

Expand Down Expand Up @@ -809,6 +810,9 @@ bool Framework::on_message(HWND wnd, UINT message, WPARAM w_param, LPARAM l_para
case WM_KILLFOCUS:
std::fill(std::begin(m_last_keys), std::end(m_last_keys), false);
break;
case WM_SETFOCUS:
std::fill(std::begin(m_last_keys), std::end(m_last_keys), false);
break;
case WM_ACTIVATE:
if (LOWORD(w_param) == WA_INACTIVE) {
return false;
Expand Down

0 comments on commit 4103c2b

Please sign in to comment.