summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2020-09-30 19:09:32 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2020-10-06 16:16:01 +0200
commite290cd189e4d3814820ee8509bdbf45a9d01e995 (patch)
treee57de95f339cf0cadfc2b0a7b0966b070daa12e7
parentca189b78bc9bfb0e6fad72e3374bf8e8408093f0 (diff)
Allow invalidate after queue_resize for lok in sidebar
This is a fix for regression introduced by 61a35560cb412d7ab0e3d0574eec4a790e3b9dfd Sidebar wasn't properly refreshed in Online eg. in Impress change 'Background' in sidebar 'Slide' deck to 'Color' -> resulted in overlapping content Change-Id: Id64f5d8694908d28cf5fa9787b65e555fb317e35 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103724 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104015 Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
-rw-r--r--vcl/source/window/window2.cxx20
1 files changed, 19 insertions, 1 deletions
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 37e34d91c00a..7a5437dee1d8 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -1306,6 +1306,19 @@ void Window::InvalidateSizeCache()
pWindowImpl->mnOptimalHeightCache = -1;
}
+static bool HasParentDockingWindow(const vcl::Window* pWindow)
+{
+ while( pWindow )
+ {
+ if( pWindow->IsDockingWindow() )
+ return true;
+
+ pWindow = pWindow->GetParent();
+ }
+
+ return pWindow && pWindow->IsDockingWindow();
+}
+
void Window::queue_resize(StateChangedType eReason)
{
if (IsDisposed())
@@ -1341,7 +1354,12 @@ void Window::queue_resize(StateChangedType eReason)
if (VclPtr<vcl::Window> pParent = GetParentWithLOKNotifier())
{
Size aSize = GetSizePixel();
- if (aSize.getWidth() > 0 && aSize.getHeight() > 0 && GetParentDialog()
+
+ // Form controls (VCL controls inside document window) was causing
+ // infinite loop of calls, so call it only for widgets having as a parent
+ // dialog or docking window (eg. sidebar)
+ if (aSize.getWidth() > 0 && aSize.getHeight() > 0
+ && (GetParentDialog() || HasParentDockingWindow(this))
&& !pParent->IsInInitShow())
LogicInvalidate(nullptr);
}