[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - vcl/source

Michael Meeks (via logerrit) logerrit at kemper.freedesktop.org
Fri Jan 10 14:09:15 UTC 2020


 vcl/source/window/paint.cxx   |    6 +++++-
 vcl/source/window/window2.cxx |    5 +++--
 2 files changed, 8 insertions(+), 3 deletions(-)

New commits:
commit ec327cf0c1057de747cadabcb404f67b15ece36f
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Fri Jan 10 12:29:48 2020 +0000
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Fri Jan 10 15:08:46 2020 +0100

    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/+/86533
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 88712e3c72fa..54d0dfc1f58c 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -1215,6 +1215,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
@@ -1223,7 +1227,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 dcf5af8a7eed..8092b1a12aba 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -1351,10 +1351,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);
     }
 }


More information about the Libreoffice-commits mailing list