mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Save and restore the console window's position.
This commit is contained in:
parent
7cef136468
commit
bff16dbd76
4 changed files with 33 additions and 0 deletions
|
@ -159,6 +159,8 @@ void Config::Load(const char *iniFileName)
|
|||
debugConfig->Get("DisasmWindowY", &iDisasmWindowY, -1);
|
||||
debugConfig->Get("DisasmWindowW", &iDisasmWindowW, -1);
|
||||
debugConfig->Get("DisasmWindowH", &iDisasmWindowH, -1);
|
||||
debugConfig->Get("ConsoleWindowX", &iConsoleWindowX, -1);
|
||||
debugConfig->Get("ConsoleWindowY", &iConsoleWindowY, -1);
|
||||
|
||||
CleanRecent();
|
||||
}
|
||||
|
@ -261,6 +263,8 @@ void Config::Save()
|
|||
debugConfig->Set("DisasmWindowY", iDisasmWindowY);
|
||||
debugConfig->Set("DisasmWindowW", iDisasmWindowW);
|
||||
debugConfig->Set("DisasmWindowH", iDisasmWindowH);
|
||||
debugConfig->Set("ConsoleWindowX", iConsoleWindowX);
|
||||
debugConfig->Set("ConsoleWindowY", iConsoleWindowY);
|
||||
|
||||
if (!iniFile.Save(iniFilename_.c_str())) {
|
||||
ERROR_LOG(LOADER, "Error saving config - can't write ini %s", iniFilename_.c_str());
|
||||
|
|
|
@ -132,6 +132,8 @@ public:
|
|||
int iDisasmWindowY;
|
||||
int iDisasmWindowW;
|
||||
int iDisasmWindowH;
|
||||
int iConsoleWindowX;
|
||||
int iConsoleWindowY;
|
||||
|
||||
std::string currentDirectory;
|
||||
std::string externalDirectory;
|
||||
|
|
|
@ -191,3 +191,21 @@ bool WindowsHost::IsDebuggingEnabled()
|
|||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void WindowsHost::SetConsolePosition()
|
||||
{
|
||||
HWND console = GetConsoleWindow();
|
||||
if (console != NULL && g_Config.iConsoleWindowX != -1 && g_Config.iConsoleWindowY != -1)
|
||||
SetWindowPos(console, NULL, g_Config.iConsoleWindowX, g_Config.iConsoleWindowY, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
|
||||
}
|
||||
|
||||
void WindowsHost::UpdateConsolePosition()
|
||||
{
|
||||
RECT rc;
|
||||
HWND console = GetConsoleWindow();
|
||||
if (console != NULL && GetWindowRect(console, &rc))
|
||||
{
|
||||
g_Config.iConsoleWindowX = rc.left;
|
||||
g_Config.iConsoleWindowY = rc.top;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,13 @@ public:
|
|||
displayWindow_ = displayWindow;
|
||||
input = getInputDevices();
|
||||
loadedSymbolMap_ = false;
|
||||
SetConsolePosition();
|
||||
}
|
||||
~WindowsHost()
|
||||
{
|
||||
UpdateConsolePosition();
|
||||
}
|
||||
|
||||
void UpdateMemView();
|
||||
void UpdateDisassembly();
|
||||
void UpdateUI();
|
||||
|
@ -52,6 +58,9 @@ public:
|
|||
void SetWindowTitle(const char *message);
|
||||
|
||||
private:
|
||||
void SetConsolePosition();
|
||||
void UpdateConsolePosition();
|
||||
|
||||
HWND displayWindow_;
|
||||
HWND mainWindow_;
|
||||
std::list<std::shared_ptr<InputDevice>> input;
|
||||
|
|
Loading…
Add table
Reference in a new issue