summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorRachel Bryk <RachelBryk@gmail.com>2013-03-15 09:19:39 -0400
committerRachel Bryk <RachelBryk@gmail.com>2013-03-15 09:19:39 -0400
commitdef578fea6ff47892c4fa45532c7437686d5ea65 (patch)
treea507b077c6fb8cb958a34417fc6907f27d2134f7 /Source/Core
parentafb6f9127ad462f09a689a0b868b51fe06376720 (diff)
Fix checks for preventing the main and render windows from spawning off screen.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinWX/Src/FrameTools.cpp9
-rw-r--r--Source/Core/DolphinWX/Src/Main.cpp9
2 files changed, 10 insertions, 8 deletions
diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp
index 11d9281281..b764e06a88 100644
--- a/Source/Core/DolphinWX/Src/FrameTools.cpp
+++ b/Source/Core/DolphinWX/Src/FrameTools.cpp
@@ -865,10 +865,11 @@ void CFrame::StartGame(const std::string& filename)
SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowHeight);
#ifdef _WIN32
// Out of desktop check
- HWND hDesktop = GetDesktopWindow();
- RECT rc;
- GetWindowRect(hDesktop, &rc);
- if (rc.right < position.x + size.GetWidth() || rc.bottom < position.y + size.GetHeight())
+ int height = GetSystemMetrics(79);
+ int width = GetSystemMetrics(78);
+ int leftPos = GetSystemMetrics(76);
+ int topPos = GetSystemMetrics(77);
+ 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
m_RenderFrame = new CRenderFrame((wxFrame*)this, wxID_ANY, _("Dolphin"), position);
diff --git a/Source/Core/DolphinWX/Src/Main.cpp b/Source/Core/DolphinWX/Src/Main.cpp
index 179c69b5f0..a4b9e07690 100644
--- a/Source/Core/DolphinWX/Src/Main.cpp
+++ b/Source/Core/DolphinWX/Src/Main.cpp
@@ -294,10 +294,11 @@ bool DolphinApp::OnInit()
// do not allow windows to be created off the desktop.
#ifdef _WIN32
// Out of desktop check
- HWND hDesktop = GetDesktopWindow();
- RECT rc;
- GetWindowRect(hDesktop, &rc);
- if (rc.right < x + w || rc.bottom < y + h)
+ int height = GetSystemMetrics(79);
+ int width = GetSystemMetrics(78);
+ int leftPos = GetSystemMetrics(76);
+ int topPos = GetSystemMetrics(77);
+ if ((leftPos + width) < (x + w) || leftPos > x || (topPos + height) < (y + h) || topPos > y)
x = y = wxDefaultCoord;
#elif defined __APPLE__
if (y < 1)