[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - drawinglayer/source

Armin Le Grand (allotropia) (via logerrit) logerrit at kemper.freedesktop.org
Fri Dec 18 06:46:51 UTC 2020


 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx |   48 +++++++++++-----
 1 file changed, 34 insertions(+), 14 deletions(-)

New commits:
commit 5592d5e97810e68bcc0a70b2892c4ad487a06f81
Author:     Armin Le Grand (allotropia) <armin.le.grand at me.com>
AuthorDate: Tue Dec 15 00:52:05 2020 +0100
Commit:     Michael Weghorn <m.weghorn at posteo.de>
CommitDate: Fri Dec 18 07:46:18 2020 +0100

    tdf#131281 Always draw FormControls when TiledRendering
    
    When FormControls are not in layout mode it would be necessary
    to have real VCL ChildWindows in the client (usually the office).
    While this is done in the office itself and thus the visualization
    of FormControls (and their usage) is guaranteed, this is currently
    not the case for existing clients of TiledRendering.
    
    The big solution would be an API for the TiledRendering client
    to get infos for FormControls and create these locally (what would
    allow to have these editable/interactive and in the style of the
    client system). As long as this is not the case, I add this fallback
    to render the FormControls as content to the tiles to get them
    visualized at all.
    
    Change-Id: I0f7a5e7dc028373145a6a19b639ce82bdafc149d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107735
    Tested-by: Jenkins
    Reviewed-by: Armin Le Grand <Armin.Le.Grand at me.com>
    (cherry picked from commit bcb8d2d3a08991b4e57189b81f8702aaa8af8a89)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107805
    Reviewed-by: Michael Weghorn <m.weghorn at posteo.de>

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 2e7aa5c96bad..f64d2b474246 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -20,6 +20,7 @@
 #include "vclpixelprocessor2d.hxx"
 #include "vclhelperbufferdevice.hxx"
 #include "helperwrongspellrenderer.hxx"
+#include <comphelper/lok.hxx>
 
 #include <sal/log.hxx>
 #include <tools/stream.hxx>
@@ -663,31 +664,50 @@ void VclPixelProcessor2D::processControlPrimitive2D(
 
         if (xNewGraphics.is())
         {
-            // link graphics and view
-            xControlView->setGraphics(xNewGraphics);
-
-            // get position
-            const basegfx::B2DHomMatrix aObjectToPixel(maCurrentTransformation
-                                                       * rControlPrimitive.getTransform());
-            const basegfx::B2DPoint aTopLeftPixel(aObjectToPixel * basegfx::B2DPoint(0.0, 0.0));
-
             // find out if the control is already visualized as a VCL-ChildWindow. If yes,
             // it does not need to be painted at all.
             uno::Reference<awt::XWindow2> xControlWindow(rXControl, uno::UNO_QUERY_THROW);
-            const bool bControlIsVisibleAsChildWindow(rXControl->getPeer().is()
-                                                      && xControlWindow->isVisible());
+            bool bControlIsVisibleAsChildWindow(rXControl->getPeer().is()
+                                                && xControlWindow->isVisible());
+
+            // tdf#131281 The FormControls are not painted when using the Tiled Rendering for a simple
+            // reason: when e.g. bControlIsVisibleAsChildWindow is true. This is the case because the
+            // office is in non-layout mode (default for controls at startup). For the common office
+            // this means that there exists a real VCL-System-Window for the control, so it is *not*
+            // painted here due to being exactly obscured by that real Window (and creates danger of
+            // flickering, too).
+            // Tiled Rendering clients usually do *not* have real VCL-Windows for the controls, but
+            // exactly that would be needed on each client displaying the tiles (what would be hard
+            // to do but also would have advantages - the clients would have real controls in the
+            //  shape of their traget system which could be interacted with...). It is also what the
+            // office does.
+            // For now, fallback to just render these controls when Tiled Rendering is active to just
+            // have them displayed on all clients.
+            if (bControlIsVisibleAsChildWindow && comphelper::LibreOfficeKit::isActive())
+            {
+                // Do force paint when we are in Tiled Renderer and FormControl is 'visible'
+                bControlIsVisibleAsChildWindow = false;
+            }
 
             if (!bControlIsVisibleAsChildWindow)
             {
-                // draw it. Do not forget to use the evtl. offsetted origin of the target device,
+                // Needs to be drawn. Link new graphics and view
+                xControlView->setGraphics(xNewGraphics);
+
+                // get position
+                const basegfx::B2DHomMatrix aObjectToPixel(maCurrentTransformation
+                                                           * rControlPrimitive.getTransform());
+                const basegfx::B2DPoint aTopLeftPixel(aObjectToPixel * basegfx::B2DPoint(0.0, 0.0));
+
+                // Do not forget to use the evtl. offsetted origin of the target device,
                 // e.g. when used with mask/transparence buffer device
                 const Point aOrigin(mpOutputDevice->GetMapMode().GetOrigin());
                 xControlView->draw(aOrigin.X() + basegfx::fround(aTopLeftPixel.getX()),
                                    aOrigin.Y() + basegfx::fround(aTopLeftPixel.getY()));
-            }
 
-            // restore original graphics
-            xControlView->setGraphics(xOriginalGraphics);
+                // restore original graphics
+                xControlView->setGraphics(xOriginalGraphics);
+            }
         }
     }
     catch (const uno::Exception&)


More information about the Libreoffice-commits mailing list