diff --git a/Common/UI/UIScreen.cpp b/Common/UI/UIScreen.cpp index 6cb3b54d1fa0..520375dae502 100644 --- a/Common/UI/UIScreen.cpp +++ b/Common/UI/UIScreen.cpp @@ -91,19 +91,19 @@ bool UIScreen::UnsyncTouch(const TouchInput &touch) { } } - std::lock_guard guard(eventQueueLock_); QueuedEvent ev{}; ev.type = QueuedEventType::TOUCH; ev.touch = touch; + std::lock_guard guard(eventQueueLock_); eventQueue_.push_back(ev); return false; } void UIScreen::UnsyncAxis(const AxisInput &axis) { - std::lock_guard guard(eventQueueLock_); QueuedEvent ev{}; ev.type = QueuedEventType::AXIS; ev.axis = axis; + std::lock_guard guard(eventQueueLock_); eventQueue_.push_back(ev); } @@ -123,10 +123,10 @@ bool UIScreen::UnsyncKey(const KeyInput &key) { } } - std::lock_guard guard(eventQueueLock_); QueuedEvent ev{}; ev.type = QueuedEventType::KEY; ev.key = key; + std::lock_guard guard(eventQueueLock_); eventQueue_.push_back(ev); return retval; } diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 13ef0d39fdd0..d82ed51ae39d 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -844,16 +844,16 @@ bool EmuScreen::UnsyncKey(const KeyInput &key) { System_Notify(SystemNotification::ACTIVITY); if (UI::IsFocusMovementEnabled()) { - if (UIScreen::UnsyncKey(key)) { - return true; - } else if ((key.flags & KEY_DOWN) != 0 && UI::IsEscapeKey(key)) { + bool retval = UIScreen::UnsyncKey(key); + if ((key.flags & KEY_DOWN) != 0 && UI::IsEscapeKey(key)) { if (chatMenu_) chatMenu_->Close(); if (chatButton_) chatButton_->SetVisibility(UI::V_VISIBLE); UI::EnableFocusMovement(false); - return true; + retval = true; } + return retval; } return controlMapper_.Key(key, &pauseTrigger_);