From 6a0ea795d58c9e005593b94b9f29ea2b3b27aba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=CC=81clav=20Slavi=CC=81k?= Date: Sun, 21 Feb 2016 18:33:34 +0100 Subject: [PATCH] Don't redraw wxSplitterWindow sash needlessly Don't draw the sash in SizeWindows() unless its position was changed by the function. --- src/generic/splitter.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/generic/splitter.cpp b/src/generic/splitter.cpp index b0bb0c62a0..d69593cf38 100644 --- a/src/generic/splitter.cpp +++ b/src/generic/splitter.cpp @@ -662,6 +662,8 @@ void wxSplitterWindow::SetSashPositionAndNotify(int sashPos) // including the edges next to the sash. void wxSplitterWindow::SizeWindows() { + int oldSashPosition = m_sashPosition; + // check if we have delayed setting the real sash position if ( m_requestedSashPosition != INT_MAX ) { @@ -727,8 +729,11 @@ void wxSplitterWindow::SizeWindows() GetWindow1()->SetSize(border, border, w1, h1); } - wxClientDC dc(this); - DrawSash(dc); + if ( oldSashPosition != m_sashPosition ) + { + wxClientDC dc(this); + DrawSash(dc); + } } // Set pane for unsplit window