diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2019-04-26 20:04:00 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2019-09-23 15:10:53 +0100 |
commit | de1229e448d4fd60e401bbefa5beb7cc5bb9eabf (patch) | |
tree | 17a8b0555557e0f083d283d6e326d88f0c5c73d3 | |
parent | 637e8103ce372e84a175ec6cc01a816fbd3b7927 (diff) |
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@collabora.com>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
-rw-r--r-- | vcl/source/window/paint.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx index 8d3f88e9dfce..a94689cc42ad 100644 --- a/vcl/source/window/paint.cxx +++ b/vcl/source/window/paint.cxx @@ -33,6 +33,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 @@ -634,6 +635,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()) { @@ -655,6 +658,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(); @@ -722,6 +727,7 @@ void Window::ImplInvalidateFrameRegion( const vcl::Region* pRegion, InvalidateFl pParent->ImplInvalidateFrameRegion( pChildRegion, nFlags ); } } + if ( !mpWindowImpl->mpFrameData->maPaintIdle.IsActive() ) mpWindowImpl->mpFrameData->maPaintIdle.Start(); } @@ -1324,10 +1330,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; } |