diff options
-rw-r--r-- | include/vcl/window.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uiview/view.cxx | 10 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 14 |
3 files changed, 25 insertions, 1 deletions
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index a105bddcdc44..57ac3197aaaa 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -913,6 +913,8 @@ public: /// Can the widget derived from this Window do the double-buffering via RenderContext properly? bool SupportsDoubleBuffering() const; + /// Enable/disable double-buffering of the frame window and all its children. + void RequestDoubleBuffering(bool bRequest); void EnableAllResize( bool bEnable = true ); diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index 4125a91ce739..9fd8dd788e4b 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -719,6 +719,10 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) m_bIsPreviewDoubleClick(false), m_bAnnotationMode(false) { + static bool bRequestDoubleBuffering = getenv("VCL_DOUBLEBUFFERING_ENABLE"); + if (bRequestDoubleBuffering) + m_pEditWin->RequestDoubleBuffering(true); + // According to discussion with MBA and further // investigations, no old SfxViewShell will be set as parameter <pOldSh>, // if function "New Window" is performed to open an additional view beside @@ -1056,7 +1060,13 @@ SwView::~SwView() m_pTogglePageBtn.disposeAndClear(); delete m_pGlosHdl; delete m_pViewImpl; + + // If this was enabled in the ctor for the frame, then disable it here. + static bool bRequestDoubleBuffering = getenv("VCL_DOUBLEBUFFERING_ENABLE"); + if (bRequestDoubleBuffering) + m_pEditWin->RequestDoubleBuffering(false); m_pEditWin.disposeAndClear(); + delete m_pFormatClipboard; } diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 35b4f06ff738..8a0d521976c4 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -1075,7 +1075,7 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p mpWindowImpl->mpFrameData->maResizeIdle.SetDebugName( "vcl::Window maResizeIdle" ); mpWindowImpl->mpFrameData->mbInternalDragGestureRecognizer = false; if (!(nStyle & WB_DEFAULTWIN) && mpWindowImpl->mbDoubleBufferingRequested) - mpWindowImpl->mpFrameData->mpBuffer = VclPtrInstance<VirtualDevice>(); + RequestDoubleBuffering(true); mpWindowImpl->mpFrameData->mbInBufferedPaint = false; if ( pRealParent && IsTopWindow() ) @@ -3908,6 +3908,18 @@ bool Window::SupportsDoubleBuffering() const return mpWindowImpl->mpFrameData->mpBuffer; } +void Window::RequestDoubleBuffering(bool bRequest) +{ + if (bRequest) + { + mpWindowImpl->mpFrameData->mpBuffer = VclPtrInstance<VirtualDevice>(); + // Make sure that the buffer size matches the frame size. + mpWindowImpl->mpFrameData->mpBuffer->SetOutputSizePixel(mpWindowImpl->mpFrameWindow->GetOutputSizePixel()); + } + else + mpWindowImpl->mpFrameData->mpBuffer.reset(); +} + /* * The rational here is that we moved destructors to * dispose and this altered a lot of code paths, that |