Fix audio focus issue by tracking the cause of lost focus.

Fixes #21643
This commit is contained in:
Henrik Rydgård committed 2026-05-06 00:06:32 +02:00
1 parent d4bd7c604c
commit 3a599c4714
16 files changed
+95 -70

No files matched your search

+2 -2
View File
@@ -150,7 +150,7 @@ void ScreenManager::switchToNext() {
stack_.push_back(nextStack_.front());
nextStack_.front().screen->focusChanged(ScreenFocusChange::FOCUS_BECAME_TOP);
delete temp.screen;
UI::SetFocusedView(nullptr);
UI::SetFocusedView(nullptr, UI::FocusFlags::CAUSE_SCREEN_CHANGE);
// When will this ever happen? Should handle focus here too?
for (size_t i = 1; i < nextStack_.size(); ++i) {
@@ -378,7 +378,7 @@ void ScreenManager::push(Screen *screen, int layerFlags) {
}
// Release touches and unfocus.
UI::SetFocusedView(nullptr);
UI::SetFocusedView(nullptr, UI::FocusFlags::CAUSE_SCREEN_CHANGE);
TouchInput input{};
input.x = -50000.0f;
input.y = -50000.0f;