Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix checks for preventing the main and render windows from spawning o…
…ff screen.
  • Loading branch information
RachelBryk committed Mar 15, 2013
1 parent afb6f91 commit def578f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions Source/Core/DolphinWX/Src/FrameTools.cpp
Expand Up @@ -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);
Expand Down
9 changes: 5 additions & 4 deletions Source/Core/DolphinWX/Src/Main.cpp
Expand Up @@ -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)
Expand Down

0 comments on commit def578f

Please sign in to comment.