Windows: Refactor console positioning, moving the code out of EmuThread.cpp

This commit is contained in:
Henrik Rydgård
2026-07-18 20:58:29 +02:00
parent 1c918729d0
commit fdf186e43b
4 changed files with 28 additions and 14 deletions
-14
View File
@@ -54,9 +54,6 @@ static GraphicsContext *g_graphicsContext;
void MainThreadFunc();
// On most other platforms, we let the "main" thread become the render thread and
// start a separate emu thread from that, if needed. Should probably switch to that
// to make it the same on all platforms.
void MainThread_Start(bool separateEmuThread) {
useEmuThread = separateEmuThread;
mainThread = std::thread(&MainThreadFunc);
@@ -152,11 +149,6 @@ void MainThreadFunc() {
// We'll start up a separate thread we'll call Emu
SetCurrentThreadName(useEmuThread ? "RenderThread" : "EmuThread");
const HWND console = GetConsoleWindow();
if (console && g_Config.iConsoleWindowX != -1 && g_Config.iConsoleWindowY != -1) {
SetWindowPos(console, NULL, g_Config.iConsoleWindowX, g_Config.iConsoleWindowY, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
}
System_SetWindowTitle("");
// We convert command line arguments to UTF-8 immediately.
@@ -319,12 +311,6 @@ void MainThreadFunc() {
delete g_graphicsContext;
g_graphicsContext = nullptr;
RECT rc;
if (console && GetWindowRect(console, &rc) && !IsIconic(console)) {
g_Config.iConsoleWindowX = rc.left;
g_Config.iConsoleWindowY = rc.top;
}
NativeShutdown();
PostMessage(MainWindow::GetHWND(), MainWindow::WM_USER_UPDATE_UI, 0, 0);