From d096a09ed8c8059bc080f66c357229f1d47f9349 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Wed, 11 Jan 2023 18:42:39 +1000 Subject: [PATCH] ImGuiManager: Fix debug window interaction with frame limit off --- src/duckstation-nogui/nogui_host.cpp | 7 +++++-- src/duckstation-qt/qthost.cpp | 7 +++++-- src/frontend-common/imgui_overlays.cpp | 9 ++++++++- src/frontend-common/imgui_overlays.h | 3 ++- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/duckstation-nogui/nogui_host.cpp b/src/duckstation-nogui/nogui_host.cpp index 9baf8ae30..820eebe4b 100644 --- a/src/duckstation-nogui/nogui_host.cpp +++ b/src/duckstation-nogui/nogui_host.cpp @@ -786,11 +786,14 @@ void Host::RenderDisplay(bool skip_present) if (!skip_present) { FullscreenUI::Render(); - ImGuiManager::RenderOverlays(); + ImGuiManager::RenderTextOverlays(); ImGuiManager::RenderOSD(); - ImGuiManager::RenderDebugWindows(); } + // Debug windows are always rendered, otherwise mouse input breaks on skip. + ImGuiManager::RenderOverlayWindows(); + ImGuiManager::RenderDebugWindows(); + g_host_display->Render(skip_present); ImGuiManager::NewFrame(); diff --git a/src/duckstation-qt/qthost.cpp b/src/duckstation-qt/qthost.cpp index 03dd23a69..9b7d2e0f9 100644 --- a/src/duckstation-qt/qthost.cpp +++ b/src/duckstation-qt/qthost.cpp @@ -1450,11 +1450,14 @@ void EmuThread::renderDisplay(bool skip_present) if (!skip_present) { FullscreenUI::Render(); - ImGuiManager::RenderOverlays(); + ImGuiManager::RenderTextOverlays(); ImGuiManager::RenderOSD(); - ImGuiManager::RenderDebugWindows(); } + // Debug windows are always rendered, otherwise mouse input breaks on skip. + ImGuiManager::RenderOverlayWindows(); + ImGuiManager::RenderDebugWindows(); + g_host_display->Render(skip_present); ImGuiManager::NewFrame(); diff --git a/src/frontend-common/imgui_overlays.cpp b/src/frontend-common/imgui_overlays.cpp index f520f84d3..dc1cfa0ab 100644 --- a/src/frontend-common/imgui_overlays.cpp +++ b/src/frontend-common/imgui_overlays.cpp @@ -128,7 +128,7 @@ static std::tuple GetMinMax(gsl::span values) static bool s_save_state_selector_ui_open = false; -void ImGuiManager::RenderOverlays() +void ImGuiManager::RenderTextOverlays() { const System::State state = System::GetState(); if (state != System::State::Shutdown) @@ -140,7 +140,14 @@ void ImGuiManager::RenderOverlays() if (g_settings.display_show_inputs && state != System::State::Paused) DrawInputsOverlay(); + } +} +void ImGuiManager::RenderOverlayWindows() +{ + const System::State state = System::GetState(); + if (state != System::State::Shutdown) + { if (s_save_state_selector_ui_open) SaveStateSelectorUI::Draw(); } diff --git a/src/frontend-common/imgui_overlays.h b/src/frontend-common/imgui_overlays.h index 163bf5c80..c295202b5 100644 --- a/src/frontend-common/imgui_overlays.h +++ b/src/frontend-common/imgui_overlays.h @@ -6,7 +6,8 @@ #include "imgui_manager.h" namespace ImGuiManager { -void RenderOverlays(); +void RenderTextOverlays(); +void RenderOverlayWindows(); } namespace SaveStateSelectorUI {