diff --git a/include/wx/generic/splitter.h b/include/wx/generic/splitter.h index ff6d170f8f..17089c53c1 100644 --- a/include/wx/generic/splitter.h +++ b/include/wx/generic/splitter.h @@ -297,7 +297,6 @@ protected: bool m_needUpdating:1; bool m_permitUnsplitAlways:1; bool m_isHot:1; - bool m_sizeAfterDPIChange:1; private: wxDECLARE_DYNAMIC_CLASS(wxSplitterWindow); diff --git a/include/wx/msw/nonownedwnd.h b/include/wx/msw/nonownedwnd.h index 5837b4baeb..10749287eb 100644 --- a/include/wx/msw/nonownedwnd.h +++ b/include/wx/msw/nonownedwnd.h @@ -24,7 +24,6 @@ public: virtual bool Reparent(wxWindowBase* newParent) wxOVERRIDE; virtual bool IsThisEnabled() const wxOVERRIDE; - virtual bool IsDPIChanging() const wxOVERRIDE; protected: virtual bool DoClearShape() wxOVERRIDE; @@ -51,9 +50,6 @@ private: // application manifest contains PerMonitorV2. bool m_perMonitorDPIaware; - // Set to true while a window is being updated after a DPI change. - bool m_dpiChanging; - wxDECLARE_NO_COPY_CLASS(wxNonOwnedWindow); }; diff --git a/include/wx/window.h b/include/wx/window.h index 38ca5fefad..2fafa644c4 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -664,9 +664,6 @@ public: // window state) virtual bool IsThisEnabled() const { return m_isEnabled; } - // returns true while a window is being updated after a DPI change - virtual bool IsDPIChanging() const { return false; } - // returns true if the window is visible, i.e. IsShown() returns true // if called on it and all its parents up to the first TLW virtual bool IsShownOnScreen() const; diff --git a/interface/wx/window.h b/interface/wx/window.h index 6437fbded6..09f275316e 100644 --- a/interface/wx/window.h +++ b/interface/wx/window.h @@ -1296,16 +1296,6 @@ public: static int ToPhys(int d, const wxWindow* w); - /** - Returns @true while a window is being updated after a DPI change. - - @remarks This function is currently only used under MSW. - - @since 3.1.6 - */ - bool IsDPIChanging() const; - - /** This functions returns the best acceptable minimal size for the window. diff --git a/src/generic/splitter.cpp b/src/generic/splitter.cpp index 453dc15623..094b021966 100644 --- a/src/generic/splitter.cpp +++ b/src/generic/splitter.cpp @@ -474,12 +474,6 @@ void wxSplitterWindow::OnSize(wxSizeEvent& event) // Apply gravity if we use it. int delta = (int) ( (size - old_size)*m_sashGravity ); - if ( winTop && winTop->IsDPIChanging() ) - { - // Keep the same relative position. - delta = wxMulDivInt32(size, m_sashPosition, old_size) - m_sashPosition; - } - // If delta == 0 then sash will be set according to the windows min size. if ( delta != 0 ) { @@ -530,6 +524,8 @@ void wxSplitterWindow::OnSize(wxSizeEvent& event) void wxSplitterWindow::OnDPIChanged(wxDPIChangedEvent& event) { m_minimumPaneSize = event.ScaleX(m_minimumPaneSize); + m_sashPosition = event.ScaleX(m_sashPosition); + m_lastSize = event.Scale(m_lastSize); event.Skip(); } diff --git a/src/msw/nonownedwnd.cpp b/src/msw/nonownedwnd.cpp index 29943dae49..b46a1d3141 100644 --- a/src/msw/nonownedwnd.cpp +++ b/src/msw/nonownedwnd.cpp @@ -143,7 +143,6 @@ wxNonOwnedWindow::wxNonOwnedWindow() m_shapeImpl = NULL; #endif // wxUSE_GRAPHICS_CONTEXT - m_dpiChanging = false; m_activeDPI = wxDefaultSize; m_perMonitorDPIaware = false; } @@ -229,11 +228,6 @@ bool wxNonOwnedWindow::IsThisEnabled() const : m_isEnabled; } -bool wxNonOwnedWindow::IsDPIChanging() const -{ - return m_dpiChanging; -} - WXLRESULT wxNonOwnedWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam) { WXLRESULT rc = 0; @@ -256,11 +250,9 @@ WXLRESULT wxNonOwnedWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPA const RECT* const prcNewWindow = reinterpret_cast(lParam); - m_dpiChanging = true; processed = HandleDPIChange(wxSize(LOWORD(wParam), HIWORD(wParam)), wxRectFromRECT(*prcNewWindow)); - m_dpiChanging = false; } break; }