From af782238106f7b61b4555af9dd5dd9cc331f44ed Mon Sep 17 00:00:00 2001 From: Rodrigo Braz Monteiro Date: Mon, 1 Jan 2007 23:08:26 +0000 Subject: [PATCH] Hopeful fix for splash screen Originally committed to SVN as r675. --- aegisub/dialog_splash.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/aegisub/dialog_splash.cpp b/aegisub/dialog_splash.cpp index a8afa617a..5122a0b3e 100644 --- a/aegisub/dialog_splash.cpp +++ b/aegisub/dialog_splash.cpp @@ -56,11 +56,16 @@ SplashScreen::SplashScreen(wxWindow *parent) #if wxUSE_DISPLAY == 1 // Center on current display - wxDisplay display(wxDisplay::GetFromPoint(parent->GetScreenPosition())); - wxRect dr = display.GetGeometry(); - wxRect window = GetScreenRect(); - window = window.CenterIn(dr); - Move(window.GetLeft(),window.GetTop()); + if (wxDisplay::GetCount() < 1) CentreOnParent(); + else { + int point = wxDisplay::GetFromPoint(parent->GetScreenPosition()); + if (point == wxNOT_FOUND) point = 0; + wxDisplay display(point); + wxRect dr = display.GetGeometry(); + wxRect window = GetScreenRect(); + window = window.CenterIn(dr); + Move(window.GetLeft(),window.GetTop()); + } #else // Center on window CentreOnParent();