Merge pull request #10443 from unknownbrackets/win-focus

Windows: Track minimize as lost focus
This commit is contained in:
Henrik Rydgård 2017-12-25 10:23:20 +01:00 committed by GitHub
commit 4b04a6db3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 4 deletions

View File

@ -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<std::mutex> guard(breaksLock);

View File

@ -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);

View File

@ -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();

View File

@ -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;