X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ce29e4fbe5d8f0c0e6972da064446204e59e9905..44353523d85ba44f62bad4ab7b27a14001d4b1ae:/src/common/wincmn.cpp diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 5115c3cce6..5f9a9a9ed7 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -438,7 +438,8 @@ void wxWindowBase::Centre(int direction) //RN: If we are using wxDisplay we get //the dimensions of the monitor the window is on, //otherwise we get the dimensions of the primary monitor -#if wxUSE_DISPLAY + //FIXME: wxDisplay::GetFromWindow only implemented on MSW +#if wxUSE_DISPLAY && defined(__WXMSW__) int nDisplay = wxDisplay::GetFromWindow((wxWindow*)this); if(nDisplay != wxNOT_FOUND) { @@ -810,10 +811,17 @@ void wxWindowBase::DoSetVirtualSize( int x, int y ) wxSize wxWindowBase::DoGetVirtualSize() const { - if (m_virtualSize == wxDefaultSize) - return GetClientSize(); + if ( m_virtualSize.IsFullySpecified() ) + return m_virtualSize; + + wxSize size = GetClientSize(); + if ( m_virtualSize.x != wxDefaultCoord ) + size.x = m_virtualSize.x; + + if ( m_virtualSize.y != wxDefaultCoord ) + size.y = m_virtualSize.y; - return m_virtualSize; + return size; } // ----------------------------------------------------------------------------