Permalink
Browse files

Merge pull request #10443 from unknownbrackets/win-focus

 Windows: Track minimize as lost focus
  • Loading branch information...
hrydgard committed Dec 25, 2017
2 parents 9b909b4 + a37a8ca commit 4b04a6db3c09492e5fd289122274a10c4c0499d5
Showing with 22 additions and 4 deletions.
  1. +6 −0 GPU/Debugger/Breakpoints.cpp
  2. +2 −0 GPU/Debugger/Breakpoints.h
  3. +2 −2 UI/MiscScreens.cpp
  4. +12 −2 Windows/MainWindow.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<std::mutex> guard(breaksLock);
@@ -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
@@ -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
@@ -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,13 +746,17 @@ namespace MainWindow
} else if (!inResizeMove) {
HandleSizeChange(wParam);
}
if (hasFocus) {
InputDevice::GainFocus();
}
break;
case SIZE_MINIMIZED:
Core_NotifyWindowHidden(true);
if (!g_Config.bPauseWhenMinimized) {
NativeMessageReceived("window minimized", "true");
}
InputDevice::LoseFocus();
break;
default:
break;

0 comments on commit 4b04a6d

Please sign in to comment.