From 8c1c0e1897165e7882a5d9d539caf93345726d9b Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 24 Dec 2017 18:03:28 -0800 Subject: [PATCH 1/3] Windows: Track minimize as lost focus. It makes sense if we have the other feature. Fixes #9918. --- Windows/MainWindow.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Windows/MainWindow.cpp b/Windows/MainWindow.cpp index 95edbb155f93..61a195000227 100644 --- a/Windows/MainWindow.cpp +++ b/Windows/MainWindow.cpp @@ -116,6 +116,7 @@ namespace MainWindow static bool g_IgnoreWM_SIZE = false; static bool inFullscreenResize = false; static bool inResizeMove = false; + static bool hasFocus = true; // gross hack bool noFocusPause = false; // TOGGLE_PAUSE state to override pause on lost focus @@ -379,6 +380,7 @@ namespace MainWindow void Minimize() { ShowWindow(hwndMain, SW_MINIMIZE); + InputDevice::LoseFocus(); } RECT DetermineWindowRectangle() { @@ -688,7 +690,9 @@ namespace MainWindow bool pause = true; if (wParam == WA_ACTIVE || wParam == WA_CLICKACTIVE) { WindowsRawInput::GainFocus(); - InputDevice::GainFocus(); + if (!IsIconic(GetHWND())) { + InputDevice::GainFocus(); + } g_activeWindow = WINDOW_MAINWINDOW; pause = false; } @@ -701,14 +705,16 @@ namespace MainWindow } } - if (wParam == WA_ACTIVE) { + if (wParam == WA_ACTIVE || wParam == WA_CLICKACTIVE) { NativeMessageReceived("got_focus", ""); + hasFocus = true; trapMouse = true; } if (wParam == WA_INACTIVE) { NativeMessageReceived("lost_focus", ""); WindowsRawInput::LoseFocus(); InputDevice::LoseFocus(); + hasFocus = false; trapMouse = false; } } @@ -740,6 +746,9 @@ namespace MainWindow } else if (!inResizeMove) { HandleSizeChange(wParam); } + if (hasFocus) { + InputDevice::GainFocus(); + } break; case SIZE_MINIMIZED: @@ -747,6 +756,7 @@ namespace MainWindow if (!g_Config.bPauseWhenMinimized) { NativeMessageReceived("window minimized", "true"); } + InputDevice::LoseFocus(); break; default: break; From f5b2a6601e9533732707e50d257d8cc27bcaa0a8 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 24 Dec 2017 18:04:18 -0800 Subject: [PATCH 2/3] UI: Fix graphics API display on start. Since it's a std::string return, it's a temporary, so returning it as a pointer may drop the value. --- UI/MiscScreens.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UI/MiscScreens.cpp b/UI/MiscScreens.cpp index 6f24d1cbb64b..577e1cedd687 100644 --- a/UI/MiscScreens.cpp +++ b/UI/MiscScreens.cpp @@ -501,8 +501,8 @@ void LogoScreen::render() { #if (defined(_WIN32) && !PPSSPP_PLATFORM(UWP)) || PPSSPP_PLATFORM(ANDROID) // Draw the graphics API, except on UWP where it's always D3D11 - const char *apiName = gr->T(screenManager()->getDrawContext()->GetInfoString(InfoField::APINAME)); - dc.DrawText(apiName, bounds.centerX(), ppsspp_org_y + 50, textColor, ALIGN_CENTER); + std::string apiName = screenManager()->getDrawContext()->GetInfoString(InfoField::APINAME); + dc.DrawText(gr->T(apiName), bounds.centerX(), ppsspp_org_y + 50, textColor, ALIGN_CENTER); #endif dc.End(); From a37a8ca4f03ee71501e64e4284d4b0209dbe8755 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 24 Dec 2017 18:05:44 -0800 Subject: [PATCH 3/3] GPU: Add quick method for debugging. Helps when you want to bail out to the debugger quickly. --- GPU/Debugger/Breakpoints.cpp | 6 ++++++ GPU/Debugger/Breakpoints.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/GPU/Debugger/Breakpoints.cpp b/GPU/Debugger/Breakpoints.cpp index 1e1effafc641..401acbcdd7ca 100644 --- a/GPU/Debugger/Breakpoints.cpp +++ b/GPU/Debugger/Breakpoints.cpp @@ -322,6 +322,12 @@ void AddTextureChangeTempBreakpoint() { textureChangeTemp = true; } +void AddAnyTempBreakpoint() { + for (int i = 0; i < 256; ++i) { + AddCmdBreakpoint(i, true); + } +} + void RemoveAddressBreakpoint(u32 addr) { std::lock_guard guard(breaksLock); diff --git a/GPU/Debugger/Breakpoints.h b/GPU/Debugger/Breakpoints.h index 282b325dd211..5a5ecb1570f0 100644 --- a/GPU/Debugger/Breakpoints.h +++ b/GPU/Debugger/Breakpoints.h @@ -38,6 +38,8 @@ namespace GPUBreakpoints { void AddTextureBreakpoint(u32 addr, bool temp = false); void AddTextureChangeTempBreakpoint(); void AddRenderTargetBreakpoint(u32 addr, bool temp = false); + // Quick way to trigger GE debugger statically. + void AddAnyTempBreakpoint(); void RemoveAddressBreakpoint(u32 addr); void RemoveCmdBreakpoint(u8 cmd);