diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2020-01-10 12:29:48 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2020-01-10 15:09:09 +0100 |
commit | 9b97efd4228489f2e54a948e676917e50902fd33 (patch) | |
tree | 964b531deb7db07cf6a4c3868bad6d4c62099ab2 /vcl | |
parent | c8273e30231ca3e92c9eabaa2f598604f96b23a3 (diff) |
lok: avoid emission storms of un-necessary invalidations.
Common when constructing widgets with VclBuilder - which avoids
the 'Show' detection Pranav introduced in 8de98e61fbc.
This saves ~80% of the ~100k mostly bogus calls I get to:
desktop::CallbackFlushHandler::processWindowEvent when opening
and closing a few windows.
Change-Id: Ie508d6e19274472b85543275aee33f078ddcbbb2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86534
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/paint.cxx | 6 | ||||
-rw-r--r-- | vcl/source/window/window2.cxx | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx index 99c6ed983a09..9f110e600a31 100644 --- a/vcl/source/window/paint.cxx +++ b/vcl/source/window/paint.cxx @@ -1220,6 +1220,10 @@ void Window::PixelInvalidate(const tools::Rectangle* pRectangle) if (comphelper::LibreOfficeKit::isDialogPainting() || !comphelper::LibreOfficeKit::isActive()) return; + Size aSize = GetSizePixel(); + if (aSize.getWidth() <= 0 || aSize.getHeight() <= 0) + return; + if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) { // In case we are routing the window, notify the client @@ -1228,7 +1232,7 @@ void Window::PixelInvalidate(const tools::Rectangle* pRectangle) aPayload.emplace_back("rectangle", pRectangle->toString()); else { - const tools::Rectangle aRect(Point(0, 0), GetSizePixel()); + const tools::Rectangle aRect(Point(0, 0), aSize); aPayload.emplace_back("rectangle", aRect.toString()); } diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 8e466704143b..685b77a15666 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -1338,10 +1338,11 @@ void Window::queue_resize(StateChangedType eReason) if (pBorderWindow) pBorderWindow->Resize(); } - if (VclPtr<vcl::Window> pParent = GetParentWithLOKNotifier()) { - if (!pParent->IsInInitShow()) + Size aSize = GetSizePixel(); + if (aSize.getWidth() > 0 && aSize.getHeight() > 0 && + !pParent->IsInInitShow()) LogicInvalidate(nullptr); } } |