From 65ecb0d8f43f99f3794fe1aa19c87c153534fbf2 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 15 Jul 2014 09:21:38 +0100 Subject: Related: fdo#80633 we can retain cached size for visibility change we still need to invalidate the layout of our parents, but we can keep the cached optimal size Change-Id: I8e77366bd61ff45d34f9d411c7f501a3a9ccbd4e --- vcl/source/control/tabctrl.cxx | 4 ++-- vcl/source/window/dialog.cxx | 2 +- vcl/source/window/layout.cxx | 4 ++-- vcl/source/window/window.cxx | 4 ++-- vcl/source/window/window2.cxx | 9 ++++++--- 5 files changed, 13 insertions(+), 10 deletions(-) (limited to 'vcl') diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index 6148a950d3e4..cb21606df3ee 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -2224,10 +2224,10 @@ Size TabControl::GetOptimalSize() const return calculateRequisition(); } -void TabControl::queue_resize() +void TabControl::queue_resize(StateChangedType eReason) { markLayoutDirty(); - Window::queue_resize(); + Window::queue_resize(eReason); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 87d9d77f674d..ef315da58934 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -1230,7 +1230,7 @@ IMPL_LINK( Dialog, ImplHandleLayoutTimerHdl, void*, EMPTYARG ) return 0; } -void Dialog::queue_resize() +void Dialog::queue_resize(StateChangedType /*eReason*/) { if (hasPendingLayout() || isCalculatingInitialLayoutSize()) return; diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 5ae34120ad43..21e49f58fd55 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -157,10 +157,10 @@ void VclContainer::SetSizePixel(const Size& rAllocation) } } -void VclContainer::queue_resize() +void VclContainer::queue_resize(StateChangedType eReason) { markLayoutDirty(); - Window::queue_resize(); + Window::queue_resize(eReason); } void VclBox::accumulateMaxes(const Size &rChildSize, Size &rSize) const diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 469933829ec3..b7166f0390d8 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -1984,7 +1984,7 @@ void Window::Tracking( const TrackingEvent& rTEvt ) pWrapper->Tracking( rTEvt ); } -void Window::StateChanged( StateChangedType eType ) +void Window::StateChanged(StateChangedType eType) { switch (eType) { @@ -2002,7 +2002,7 @@ void Window::StateChanged( StateChangedType eType ) break; //stuff that does invalidate the layout default: - queue_resize(); + queue_resize(eType); break; } } diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 52ccd629f6b0..cabf358f094c 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -1423,13 +1423,16 @@ namespace } } -void Window::queue_resize() +void Window::queue_resize(StateChangedType eReason) { bool bSomeoneCares = queue_ungrouped_resize(this); WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; - pWindowImpl->mnOptimalWidthCache = -1; - pWindowImpl->mnOptimalHeightCache = -1; + if (eReason != STATE_CHANGE_VISIBLE) + { + pWindowImpl->mnOptimalWidthCache = -1; + pWindowImpl->mnOptimalHeightCache = -1; + } if (pWindowImpl->m_xSizeGroup && pWindowImpl->m_xSizeGroup->get_mode() != VCL_SIZE_GROUP_NONE) { std::set &rWindows = pWindowImpl->m_xSizeGroup->get_widgets(); -- cgit