From 7d0eac730ff655c442af97d2c76279b72fc5424c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 25 Mar 2023 10:43:00 +0100 Subject: [PATCH] Remove WindowsHost --- UI/NativeApp.cpp | 3 --- Windows/EmuThread.cpp | 4 +++- Windows/WindowsHost.cpp | 30 ++---------------------------- Windows/WindowsHost.h | 14 ++------------ 4 files changed, 7 insertions(+), 44 deletions(-) diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index ab45c8cae3..6775d95647 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -119,9 +119,6 @@ #include "UI/RemoteISOScreen.h" #include "UI/Theme.h" -#if !defined(MOBILE_DEVICE) && defined(USING_QT_UI) -#include "Qt/QtHost.h" -#endif #if defined(USING_QT_UI) #include #endif diff --git a/Windows/EmuThread.cpp b/Windows/EmuThread.cpp index 2616428696..b59cd60534 100644 --- a/Windows/EmuThread.cpp +++ b/Windows/EmuThread.cpp @@ -155,7 +155,9 @@ void MainThreadFunc() { // We'll start up a separate thread we'll call Emu SetCurrentThreadName(useEmuThread ? "Render" : "Emu"); - host = new WindowsHost(); + host = new Host(); + + SetConsolePosition(); System_SetWindowTitle(""); diff --git a/Windows/WindowsHost.cpp b/Windows/WindowsHost.cpp index be4511ad8f..8a2d877bf9 100644 --- a/Windows/WindowsHost.cpp +++ b/Windows/WindowsHost.cpp @@ -19,25 +19,11 @@ #include -// For shell links -#include "Common/CommonWindows.h" -#include "winnls.h" -#include "shobjidl.h" -#include "objbase.h" -#include "objidl.h" -#include "shlguid.h" -#pragma warning(push) -#pragma warning(disable:4091) // workaround bug in VS2015 headers -#include "shlobj.h" -#pragma warning(pop) - // native stuff #include "Common/System/Display.h" #include "Common/System/NativeApp.h" #include "Common/Input/InputState.h" #include "Common/Input/KeyCodes.h" -#include "Common/Data/Encoding/Utf8.h" -#include "Common/File/DirListing.h" #include "Common/StringUtils.h" #include "Core/Core.h" @@ -55,10 +41,6 @@ #include "Windows/WindowsHost.h" #include "Windows/MainWindow.h" -#include "Windows/Debugger/DebuggerShared.h" -#include "Windows/Debugger/Debugger_Disasm.h" -#include "Windows/Debugger/Debugger_MemoryDlg.h" - #ifndef _M_ARM #include "Windows/DinputDevice.h" #endif @@ -66,22 +48,14 @@ #include "Windows/main.h" -static BOOL PostDialogMessage(Dialog *dialog, UINT message, WPARAM wParam = 0, LPARAM lParam = 0) { - return PostMessage(dialog->GetDlgHandle(), message, wParam, lParam); -} - -WindowsHost::WindowsHost() { - SetConsolePosition(); -} - -void WindowsHost::SetConsolePosition() { +void 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() { +void UpdateConsolePosition() { RECT rc; HWND console = GetConsoleWindow(); if (console != NULL && GetWindowRect(console, &rc) && !IsIconic(console)) { diff --git a/Windows/WindowsHost.h b/Windows/WindowsHost.h index 7168b5b199..dfdc2ab268 100644 --- a/Windows/WindowsHost.h +++ b/Windows/WindowsHost.h @@ -19,20 +19,10 @@ #include #include "Common/CommonWindows.h" -#include "Core/Host.h" #include "Windows/InputDevice.h" -class WindowsHost : public Host { -public: - WindowsHost(); - ~WindowsHost() { - UpdateConsolePosition(); - } - -private: - void SetConsolePosition(); - void UpdateConsolePosition(); -}; +void SetConsolePosition(); +void UpdateConsolePosition(); class WindowsInputManager { public: