diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index b764e06a88..e72b5db13d 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -74,6 +74,20 @@ Core::GetWindowHandle(). #include // wxWidgets +#ifdef _WIN32 +#ifndef SM_YVIRTUALSCREEN +#define SM_YVIRTUALSCREEN 77 +#endif +#ifndef SM_XVIRTUALSCREEN +#define SM_XVIRTUALSCREEN 76 +#endif +#ifndef SM_CXVIRTUALSCREEN +#define SM_CXVIRTUALSCREEN 78 +#endif +#ifndef SM_CYVIRTUALSCREEN +#define SM_CYVIRTUALSCREEN 79 +#endif +#endif // Resources extern "C" { @@ -865,10 +879,10 @@ void CFrame::StartGame(const std::string& filename) SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowHeight); #ifdef _WIN32 // Out of desktop check - int height = GetSystemMetrics(79); - int width = GetSystemMetrics(78); - int leftPos = GetSystemMetrics(76); - int topPos = GetSystemMetrics(77); + int height = GetSystemMetrics(SM_CYVIRTUALSCREEN); + int width = GetSystemMetrics(SM_CXVIRTUALSCREEN); + int leftPos = GetSystemMetrics(SM_XVIRTUALSCREEN); + int topPos = GetSystemMetrics(SM_YVIRTUALSCREEN); if ((leftPos + width) < (position.x + size.GetWidth()) || leftPos > position.x || (topPos + height) < (position.y + size.GetHeight()) || topPos > position.y) position.x = position.y = wxDefaultCoord; #endif diff --git a/Source/Core/DolphinWX/Src/Main.cpp b/Source/Core/DolphinWX/Src/Main.cpp index a4b9e07690..20dbfa80cf 100644 --- a/Source/Core/DolphinWX/Src/Main.cpp +++ b/Source/Core/DolphinWX/Src/Main.cpp @@ -48,6 +48,20 @@ #ifdef _WIN32 #include + +#ifndef SM_YVIRTUALSCREEN +#define SM_YVIRTUALSCREEN 77 +#endif +#ifndef SM_XVIRTUALSCREEN +#define SM_XVIRTUALSCREEN 76 +#endif +#ifndef SM_CXVIRTUALSCREEN +#define SM_CXVIRTUALSCREEN 78 +#endif +#ifndef SM_CYVIRTUALSCREEN +#define SM_CYVIRTUALSCREEN 79 +#endif + #endif // Nvidia drivers >= v302 will check if the application exports a global @@ -294,10 +308,10 @@ bool DolphinApp::OnInit() // do not allow windows to be created off the desktop. #ifdef _WIN32 // Out of desktop check - int height = GetSystemMetrics(79); - int width = GetSystemMetrics(78); - int leftPos = GetSystemMetrics(76); - int topPos = GetSystemMetrics(77); + int height = GetSystemMetrics(SM_CYVIRTUALSCREEN); + int width = GetSystemMetrics(SM_CXVIRTUALSCREEN); + int leftPos = GetSystemMetrics(SM_XVIRTUALSCREEN); + int topPos = GetSystemMetrics(SM_YVIRTUALSCREEN); if ((leftPos + width) < (x + w) || leftPos > x || (topPos + height) < (y + h) || topPos > y) x = y = wxDefaultCoord; #elif defined __APPLE__