summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-07-15 09:21:38 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-07-15 11:56:09 +0100
commit65ecb0d8f43f99f3794fe1aa19c87c153534fbf2 (patch)
tree61dc4dd87e68520eee49be0a47d713e0cfed5c1b /vcl
parent835c9e6d842fb726e11afee032ef1d25d28efd58 (diff)
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
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/control/tabctrl.cxx4
-rw-r--r--vcl/source/window/dialog.cxx2
-rw-r--r--vcl/source/window/layout.cxx4
-rw-r--r--vcl/source/window/window.cxx4
-rw-r--r--vcl/source/window/window2.cxx9
5 files changed, 13 insertions, 10 deletions
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<Window*> &rWindows = pWindowImpl->m_xSizeGroup->get_widgets();