summaryrefslogtreecommitdiff
path: root/vcl/source/window/window.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-02-01 13:28:07 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-09-28 08:48:08 +0100
commit2b05e3f639b88d0db23691f846eeb615048efe05 (patch)
tree5ace2721f896f598f6f706ae3c8cd8a7dab86d52 /vcl/source/window/window.cxx
parente333190a695ed21fd02c4417f826e4e280b63402 (diff)
reduce flicker with another timer
Diffstat (limited to 'vcl/source/window/window.cxx')
-rw-r--r--vcl/source/window/window.cxx39
1 files changed, 20 insertions, 19 deletions
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 35df88732ec9..5b4cdaacb804 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -2477,6 +2477,9 @@ void Window::ImplPostPaint()
IMPL_LINK_NOARG(Window, ImplHandlePaintHdl)
{
+ if (IsDialog() && static_cast<const Dialog*>(this)->hasPendingLayout())
+ return 0;
+
// save paint events until resizing is done
if( mpWindowImpl->mbFrame && mpWindowImpl->mpFrameData->maResizeTimer.IsActive() )
mpWindowImpl->mpFrameData->maPaintTimer.Start();
@@ -9577,29 +9580,27 @@ Selection Window::GetSurroundingTextSelection() const
void Window::queueResize()
{
Dialog *pParent = GetParentDialog();
- if (pParent && pParent->isLayoutEnabled())
+ if (!pParent)
+ return;
+ if (!pParent->isLayoutEnabled())
+ return;
+ if (!pParent->IsReallyShown())
{
- //To-Do: integrate with mpWindowImpl->mpFrameData->maResizeTimer.SetTimeout( 50 );
- if (pParent->IsReallyShown())
- {
- pParent->Resize();
- }
- else
- {
- //resize dialog to fit requisition
- //To-Do: honour explicit sizes ?
- const Box *pContainer = dynamic_cast<const Box*>(pParent->GetChild(0));
- Size aSize = pContainer->GetOptimalSize(WINDOWSIZE_PREFERRED);
+ //resize dialog to fit requisition
+ //To-Do: honour explicit sizes ?
+ const Box *pContainer = dynamic_cast<const Box*>(pParent->GetChild(0));
+ Size aSize = pContainer->GetOptimalSize(WINDOWSIZE_PREFERRED);
- Size aMax = pParent->GetOptimalSize(WINDOWSIZE_MAXIMUM);
- aSize.Width() = std::min(aMax.Width(), aSize.Width());
- aSize.Height() = std::min(aMax.Height(), aSize.Height());
+ Size aMax = pParent->GetOptimalSize(WINDOWSIZE_MAXIMUM);
+ aSize.Width() = std::min(aMax.Width(), aSize.Width());
+ aSize.Height() = std::min(aMax.Height(), aSize.Height());
- pParent->SetMinOutputSizePixel(aSize);
- pParent->SetSizePixel(aSize);
- pParent->Resize();
- }
+ pParent->SetMinOutputSizePixel(aSize);
+ pParent->SetSizePixel(aSize);
}
+ if (pParent->hasPendingLayout())
+ return;
+ pParent->Resize();
}
void Window::setChildAnyProperty(const rtl::OString &rString, const Any &rValue)