[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

Miklos Vajna vmiklos at collabora.co.uk
Mon Aug 3 03:51:59 PDT 2015


 vcl/source/window/paint.cxx   |    9 +++++----
 vcl/source/window/winproc.cxx |    7 +++++++
 2 files changed, 12 insertions(+), 4 deletions(-)

New commits:
commit 4acfac8501cebf24e614be090efde12b3b4df392
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Jul 31 15:28:20 2015 +0200

    tdf#92982 vcl rendercontext: set buffer size in ImplHandleResize()
    
    Instead of in PaintHelper::StartBufferedPaint(). If the buffer size is
    set to match the size of a sub-widget (for which the paint was
    triggered), then client using the buffer as a persistent vdev are unable
    to paint at arbitrary locations.
    
    For example, if we painted the ruler, then the blinking cursor won't be
    able to paint to the SwEditWin area.
    
    (cherry picked from commits 161f7533ac177c25516ec206233936bd6982e3df and
    43ac95ab64980ed958ba144c33971f897791d15f)
    
    Change-Id: Iba07070baafb5b802fc6da200696611afd2010d7
    Reviewed-on: https://gerrit.libreoffice.org/17490
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 406c141..c529d13 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -114,8 +114,12 @@ void PaintHelper::StartBufferedPaint()
 
     // Instead of creating a new VirtualDevice, just erase the area we'll be
     // painting over, as VirtualDevice::ImplInitVirDev() would do.
+    // The painted area is m_aPaintRect, or in case it's empty, then the whole window.
     pFrameData->mpBuffer->SetBackground(Wallpaper(Color(COL_WHITE)));
-    pFrameData->mpBuffer->Erase(m_aPaintRect);
+    if (m_aPaintRect.IsEmpty())
+        pFrameData->mpBuffer->Erase(Rectangle(Point(0, 0), m_pWindow->GetOutputSize()));
+    else
+        pFrameData->mpBuffer->Erase(m_aPaintRect);
 
     pFrameData->mbInBufferedPaint = true;
     m_bCreatedBuffer = true;
@@ -125,9 +129,6 @@ void PaintHelper::StartBufferedPaint()
     // Remember what was the map mode of m_aPaintRect.
     m_aPaintRectMapMode = m_pWindow->GetMapMode();
 
-    // update the output size now, after all the settings were copied
-    pFrameData->mpBuffer->SetOutputSize(m_pWindow->GetOutputSize());
-
     // we need to remember the mnOutOffX / mnOutOffY, but actually really
     // set it just temporarily for the subwidgets - so we are setting it here
     // only to remember the value & to be able to pass it to the descendants
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 06d8fa8..304753a 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -35,6 +35,7 @@
 #include <vcl/help.hxx>
 #include <vcl/dockwin.hxx>
 #include <vcl/menu.hxx>
+#include <vcl/virdev.hxx>
 #include <touch/touch.h>
 
 #include <svdata.hxx>
@@ -1712,6 +1713,12 @@ void ImplHandleResize( vcl::Window* pWindow, long nNewWidth, long nNewHeight )
             }
             else
                 pWindow->ImplGetWindowImpl()->mbCallResize = true;
+
+            if (pWindow->SupportsDoubleBuffering() && pWindow->ImplGetWindowImpl()->mbFrame)
+            {
+                // Propagate resize for the frame's buffer.
+                pWindow->ImplGetWindowImpl()->mpFrameData->mpBuffer->SetOutputSizePixel(pWindow->GetOutputSizePixel());
+            }
         }
     }
 


More information about the Libreoffice-commits mailing list