From d8a7bfd4382854c6ba6dc71ddaeaa724f5516f34 Mon Sep 17 00:00:00 2001 From: Jonathan Li Date: Sun, 6 Sep 2015 21:23:02 +0100 Subject: [PATCH] gui: Adjust mainframe size and status bar position There are a few odd things with Windows and the background logo. 1. The windows containing the logo is smaller than the logo. 2. The fitting algorithm doesn't work at 200% DPI. Both make no sense, but can apparently be worked around. --- pcsx2/gui/MainFrame.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pcsx2/gui/MainFrame.cpp b/pcsx2/gui/MainFrame.cpp index d1bfdbb429..41f38e9c9c 100644 --- a/pcsx2/gui/MainFrame.cpp +++ b/pcsx2/gui/MainFrame.cpp @@ -348,7 +348,9 @@ MainEmuFrame::MainEmuFrame(wxWindow* parent, const wxString& title) // ------------------------------------------------------------------------ - wxSize backsize( m_background.GetSize() ); + // The background logo and its window size are different on Windows. Use the + // background logo size, which is what it'll eventually be resized to. + wxSize backsize(m_background.GetBitmap().GetWidth(), m_background.GetBitmap().GetHeight()); wxString wintitle; if( PCSX2_isReleaseVersion ) @@ -385,6 +387,10 @@ MainEmuFrame::MainEmuFrame(wxWindow* parent, const wxString& title) wxBoxSizer& joe( *new wxBoxSizer( wxVERTICAL ) ); joe.Add( &m_background ); SetSizerAndFit( &joe ); + // Makes no sense, but this is needed for the window size to be correct for + // 200% DPI on Windows. The SetSizerAndFit is supposed to be doing the exact + // same thing. + GetSizer()->SetSizeHints(this); // Use default window position if the configured windowpos is invalid (partially offscreen) if( g_Conf->MainGuiPosition == wxDefaultPosition || !pxIsValidWindowPosition( *this, g_Conf->MainGuiPosition) )