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

Michael Meeks (via logerrit) logerrit at kemper.freedesktop.org
Thu May 2 08:29:25 UTC 2019


 vcl/source/window/paint.cxx |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit d36f089b2898ed4d066fc656f36543c9e13c0f48
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Fri Apr 26 20:04:00 2019 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Thu May 2 10:28:44 2019 +0200

    lok: disable VCL painting and whole window invalidation.
    
    The reasoning is somewhat complex:
    
    void Window::ImplInvalidateFrameRegion( const vcl::Region* pRegion, InvalidateFlags nFlags )
    
    sets the mnPaintFlags on the mpWindowImpl - and then queues an idle
    paint. This paint in LOK mode does ~nothing - since all rendering is
    tiled, although amazingly it does emit eg. selection callbacks.
    
    However the paint flag - changes the behavior of Window::Update() to
    force a complete window invalidate. This happens, but only rarely -
    when a key-event manages to get into the mainloop before the idle
    paint handler arrives and does nothing (except clear the paint flags).
    
    So - don't do these big invalidations we don't need to in lok mode,
    unless it is for dialogs - which presumably Pranav wanted fixed by
    625087b58f3b7.
    
    Change-Id: I88dda34b8d8bba9c89296d883ad9169fe49a7c5e
    Reviewed-on: https://gerrit.libreoffice.org/71396
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 4baaf3e8bf10..6fd447cbce70 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -32,6 +32,7 @@
 #include <salframe.hxx>
 #include <svdata.hxx>
 #include <comphelper/lok.hxx>
+#include <comphelper/profilezone.hxx>
 #if HAVE_FEATURE_OPENGL
 #include <vcl/opengl/OpenGLHelper.hxx>
 #endif
@@ -633,6 +634,8 @@ void Window::ImplCallOverlapPaint()
 
 IMPL_LINK_NOARG(Window, ImplHandlePaintHdl, Timer *, void)
 {
+    comphelper::ProfileZone aZone("VCL idle re-paint");
+
     // save paint events until layout is done
     if (IsSystemWindow() && static_cast<const SystemWindow*>(this)->hasPendingLayout())
     {
@@ -654,6 +657,8 @@ IMPL_LINK_NOARG(Window, ImplHandlePaintHdl, Timer *, void)
 
 IMPL_LINK_NOARG(Window, ImplHandleResizeTimerHdl, Timer *, void)
 {
+    comphelper::ProfileZone aZone("VCL idle resize");
+
     if( mpWindowImpl->mbReallyVisible )
     {
         ImplCallResize();
@@ -721,6 +726,7 @@ void Window::ImplInvalidateFrameRegion( const vcl::Region* pRegion, InvalidateFl
             pParent->ImplInvalidateFrameRegion( pChildRegion, nFlags );
         }
     }
+
     if ( !mpWindowImpl->mpFrameData->maPaintIdle.IsActive() )
         mpWindowImpl->mpFrameData->maPaintIdle.Start();
 }
@@ -1330,10 +1336,13 @@ void Window::Update()
          }
 
         pUpdateWindow->ImplCallPaint(nullptr, pUpdateWindow->mpWindowImpl->mnPaintFlags);
-        pUpdateWindow->LogicInvalidate(nullptr);
+
+        if (comphelper::LibreOfficeKit::isActive() && pUpdateWindow->GetParentDialog())
+            pUpdateWindow->LogicInvalidate(nullptr);
 
         if (xWindow->IsDisposed())
            return;
+
         bFlush = true;
     }
 


More information about the Libreoffice-commits mailing list