Skip to content

Commit

Permalink
Fix closing the chat window with ESC, see #18134
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Sep 11, 2023
1 parent ec33bcf commit 4df4adb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Common/UI/UIScreen.cpp
Expand Up @@ -91,19 +91,19 @@ bool UIScreen::UnsyncTouch(const TouchInput &touch) {
}
}

std::lock_guard<std::mutex> guard(eventQueueLock_);
QueuedEvent ev{};
ev.type = QueuedEventType::TOUCH;
ev.touch = touch;
std::lock_guard<std::mutex> guard(eventQueueLock_);
eventQueue_.push_back(ev);
return false;
}

void UIScreen::UnsyncAxis(const AxisInput &axis) {
std::lock_guard<std::mutex> guard(eventQueueLock_);
QueuedEvent ev{};
ev.type = QueuedEventType::AXIS;
ev.axis = axis;
std::lock_guard<std::mutex> guard(eventQueueLock_);
eventQueue_.push_back(ev);
}

Expand All @@ -123,10 +123,10 @@ bool UIScreen::UnsyncKey(const KeyInput &key) {
}
}

std::lock_guard<std::mutex> guard(eventQueueLock_);
QueuedEvent ev{};
ev.type = QueuedEventType::KEY;
ev.key = key;
std::lock_guard<std::mutex> guard(eventQueueLock_);
eventQueue_.push_back(ev);
return retval;
}
Expand Down
8 changes: 4 additions & 4 deletions UI/EmuScreen.cpp
Expand Up @@ -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_);
Expand Down

0 comments on commit 4df4adb

Please sign in to comment.