From 1728367684602bb897fd9a8518c40b071cb55a22 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Mon, 22 Nov 2021 18:17:10 +0100 Subject: [PATCH] avoid only painting to windows in LOK mode, not invalidations MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 9b73d3e8926d5f9b10464d19b539eef3eb088f50 disabled painting to windows in LOK mode, because it doesn't make sense as those windows are not even visible, but it tried to do it by avoiding even invalidations. That can trigger problems because some dialogs actually are forwarded to clients in LOK mode, and apparently they need the invalidations to proceed normally (the Format->Cell dialog in Online didn't repaint scrolling of the Date listbox, I don't know what exactly the actual problem was, but mnPaintFlags were different than when not avoiding invalidations). So revert most of the relevant commits and keep only avoiding actual drawing, which is what 057968bbce406efe6564347329df45b7e did. Change-Id: I4e212966830f4c690e6143b9d5fedbc24619e1ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125674 Tested-by: Jenkins Reviewed-by: Luboš Luňák --- vcl/source/window/paint.cxx | 35 +++++------------------------------ 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx index 1c983ff7b37a..b2b7db7b6557 100644 --- a/vcl/source/window/paint.cxx +++ b/vcl/source/window/paint.cxx @@ -647,13 +647,6 @@ void Window::ImplCallOverlapPaint() IMPL_LINK_NOARG(Window, ImplHandlePaintHdl, Timer *, void) { - if (comphelper::LibreOfficeKit::isActive()) - { - // Tiled rendering is used, idle paint does not need to do anything. - mpWindowImpl->mpFrameData->maPaintIdle.Stop(); - return; - } - comphelper::ProfileZone aZone("VCL idle re-paint"); // save paint events until layout is done @@ -672,6 +665,9 @@ IMPL_LINK_NOARG(Window, ImplHandlePaintHdl, Timer *, void) else if ( mpWindowImpl->mbReallyVisible ) { ImplCallOverlapPaint(); + if (comphelper::LibreOfficeKit::isActive() && + mpWindowImpl->mpFrameData->maPaintIdle.IsActive()) + mpWindowImpl->mpFrameData->maPaintIdle.Stop(); } } @@ -692,12 +688,6 @@ IMPL_LINK_NOARG(Window, ImplHandleResizeTimerHdl, Timer *, void) void Window::ImplInvalidateFrameRegion( const vcl::Region* pRegion, InvalidateFlags nFlags ) { - if (comphelper::LibreOfficeKit::isActive()) - { - // Tiled rendering is used, so there's no need to invalidate for idle painting. - return; - } - // set PAINTCHILDREN for all parent windows till the first OverlapWindow if ( !ImplIsOverlapWindow() ) { @@ -759,12 +749,6 @@ void Window::ImplInvalidateFrameRegion( const vcl::Region* pRegion, InvalidateFl void Window::ImplInvalidateOverlapFrameRegion( const vcl::Region& rRegion ) { - if (comphelper::LibreOfficeKit::isActive()) - { - // Tiled rendering is used, so there's no need to invalidate for idle painting. - return; - } - vcl::Region aRegion = rRegion; ImplClipBoundaries( aRegion, true, true ); @@ -795,12 +779,6 @@ void Window::ImplInvalidateParentFrameRegion( const vcl::Region& rRegion ) void Window::ImplInvalidate( const vcl::Region* pRegion, InvalidateFlags nFlags ) { - if (comphelper::LibreOfficeKit::isActive()) - { - // Tiled rendering is used, so there's no need to invalidate for idle painting. - return; - } - // check what has to be redrawn bool bInvalidateAll = !pRegion; @@ -1180,11 +1158,8 @@ void Window::Invalidate( const tools::Rectangle& rRect, InvalidateFlags nFlags ) tools::Rectangle aRect = pOutDev->ImplLogicToDevicePixel( rRect ); if ( !aRect.IsEmpty() ) { - if (!comphelper::LibreOfficeKit::isActive()) - { // ImplInvalidate() immediately returns in LOK mode, skip useless Region construction - vcl::Region aRegion( aRect ); - ImplInvalidate( &aRegion, nFlags ); - } + vcl::Region aRegion( aRect ); + ImplInvalidate( &aRegion, nFlags ); tools::Rectangle aLogicRectangle(rRect); LogicInvalidate(&aLogicRectangle); } -- 2.11.4.GIT