mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 13:30:02 +00:00
Merge pull request #18077 from hrydgard/fix-input-events
Avoid double-processing of input events caused by the overlay screen.
This commit is contained in:
commit
828328b50d
@ -49,15 +49,13 @@ void ScreenManager::update() {
|
||||
}
|
||||
|
||||
if (overlayScreen_) {
|
||||
// NOTE: This is not a full UIScreen update, to avoid double global event processing.
|
||||
overlayScreen_->update();
|
||||
}
|
||||
if (stack_.size()) {
|
||||
stack_.back().screen->update();
|
||||
}
|
||||
|
||||
// NOTE: We should not update the OverlayScreen. In fact, we must never update more than one
|
||||
// UIScreen in here, because we might end up double-processing the stuff in Root.cpp.
|
||||
|
||||
g_iconCache.FrameUpdate();
|
||||
}
|
||||
|
||||
|
@ -73,12 +73,13 @@ protected:
|
||||
bool ignoreInsets_ = false;
|
||||
bool ignoreInput_ = false;
|
||||
|
||||
private:
|
||||
protected:
|
||||
void DoRecreateViews();
|
||||
|
||||
bool recreateViews_ = true;
|
||||
bool lastVertical_;
|
||||
|
||||
private:
|
||||
std::mutex eventQueueLock_;
|
||||
std::deque<QueuedEvent> eventQueue_;
|
||||
};
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "Common/UI/IconCache.h"
|
||||
#include "UI/RetroAchievementScreens.h"
|
||||
#include "UI/DebugOverlay.h"
|
||||
#include "UI/Root.h"
|
||||
|
||||
#include "Common/UI/Context.h"
|
||||
#include "Common/System/OSD.h"
|
||||
@ -526,6 +527,17 @@ void OSDOverlayScreen::render() {
|
||||
}
|
||||
}
|
||||
|
||||
void OSDOverlayScreen::update() {
|
||||
// Partial version of UIScreen::update() but doesn't do event processing to avoid duplicate event processing.
|
||||
bool vertical = UseVerticalLayout();
|
||||
if (vertical != lastVertical_) {
|
||||
RecreateViews();
|
||||
lastVertical_ = vertical;
|
||||
}
|
||||
|
||||
DoRecreateViews();
|
||||
}
|
||||
|
||||
void NoticeView::GetContentDimensionsBySpec(const UIContext &dc, UI::MeasureSpec horiz, UI::MeasureSpec vert, float &w, float &h) const {
|
||||
Bounds bounds(0, 0, layoutParams_->width, layoutParams_->height);
|
||||
if (bounds.w < 0) {
|
||||
|
@ -42,6 +42,7 @@ public:
|
||||
|
||||
void CreateViews() override;
|
||||
void render() override;
|
||||
void update() override;
|
||||
|
||||
private:
|
||||
OnScreenMessagesView *osmView_ = nullptr;
|
||||
|
Loading…
Reference in New Issue
Block a user