tdf#127211 Revert "tdf#71087 sfx2: avoid flicker in the start center"

This reverts commit d5c7657c541c1f6d17bfe5e605594c235eecfcdb.

By the time I created that, I forgot to test the case when there are no
recent documents. I'm not exactly sure how to fix that, so just go back
to the old behavior for now (trading a regression for a normal bug).

Change-Id: I8abc251a3e6506ca17429ba106e2dd70fff31556
Reviewed-on: https://gerrit.libreoffice.org/78301
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
diff --git a/sfx2/source/dialog/backingcomp.cxx b/sfx2/source/dialog/backingcomp.cxx
index dea33fa..eb29da2 100644
--- a/sfx2/source/dialog/backingcomp.cxx
+++ b/sfx2/source/dialog/backingcomp.cxx
@@ -576,12 +576,6 @@ void SAL_CALL BackingComp::dispose()
    {
        m_xWindow->removeEventListener(this);
        m_xWindow->removeKeyListener(this);
        VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(m_xWindow);
        auto pBack = dynamic_cast<BackingWindow*>(pWindow.get());
        if (pBack)
        {
            pBack->RequestDoubleBuffering(false);
        }
        m_xWindow.clear();
    }

@@ -666,10 +660,6 @@ void SAL_CALL BackingComp::initialize( /*IN*/ const css::uno::Sequence< css::uno
    // create the component window
    VclPtr<vcl::Window> pParent = VCLUnoHelper::GetWindow(xParentWindow);
    VclPtr<vcl::Window> pWindow = VclPtr<BackingWindow>::Create(pParent);
    if (!pWindow->IsNativeControlSupported(ControlType::Pushbutton, ControlPart::Focus))
    {
        pWindow->RequestDoubleBuffering(true);
    }
    m_xWindow = VCLUnoHelper::GetInterface(pWindow);

    if (!m_xWindow.is())
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index ad70dae..ffad881 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -1080,13 +1080,7 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext)
                                  aInRect, bDrawMenuSep, nButtonStyle);

        if (HasFocus())
        {
            ShowFocus(ImplGetFocusRect());
            if (SupportsDoubleBuffering())
            {
                rRenderContext.Invert(ImplGetFocusRect(), InvertFlags::TrackFrame);
            }
        }
    }

    if (!bNativeOK)
@@ -1113,10 +1107,6 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext)
        if (HasFocus())
        {
            ShowFocus(ImplGetFocusRect());
            if (SupportsDoubleBuffering())
            {
                rRenderContext.Invert(ImplGetFocusRect(), InvertFlags::TrackFrame);
            }
        }
    }
}
diff --git a/vcl/source/window/bufferdevice.cxx b/vcl/source/window/bufferdevice.cxx
index ccdf541..d148058 100644
--- a/vcl/source/window/bufferdevice.cxx
+++ b/vcl/source/window/bufferdevice.cxx
@@ -31,8 +31,6 @@ BufferDevice::~BufferDevice()
vcl::RenderContext* BufferDevice::operator->() { return m_pBuffer.get(); }

vcl::RenderContext& BufferDevice::operator*() { return *m_pBuffer; }

vcl::RenderContext& BufferDevice::GetRenderContext() { return *m_pBuffer; }
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/bufferdevice.hxx b/vcl/source/window/bufferdevice.hxx
index 75e89f9..26bf28e 100644
--- a/vcl/source/window/bufferdevice.hxx
+++ b/vcl/source/window/bufferdevice.hxx
@@ -25,7 +25,6 @@ class BufferDevice
public:
    BufferDevice(const VclPtr<vcl::Window>& pWindow, vcl::RenderContext& rRenderContext);
    ~BufferDevice();
    vcl::RenderContext& GetRenderContext();

    vcl::RenderContext* operator->();
    vcl::RenderContext& operator*();
diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx
index e9d9376..040385d 100644
--- a/vcl/source/window/menubarwindow.cxx
+++ b/vcl/source/window/menubarwindow.cxx
@@ -913,20 +913,8 @@ void MenuBarWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Recta
        return;
    }

    vcl::RenderContext* pBuffer = nullptr;
    std::unique_ptr<vcl::BufferDevice> pBufferDevice;
    if (SupportsDoubleBuffering())
    {
        // No need to buffer twice, just set up the background.
        pBuffer = &rRenderContext;
        pBuffer->Erase(tools::Rectangle(Point(GetOutOffXPixel(), GetOutOffYPixel()), GetOutputSizePixel()));
    }
    else
    {
        // Make sure that all actual rendering happens in one go to avoid flicker.
        pBufferDevice.reset(new vcl::BufferDevice(this, rRenderContext));
        pBuffer = &pBufferDevice->GetRenderContext();
    }
    // Make sure that all actual rendering happens in one go to avoid flicker.
    vcl::BufferDevice pBuffer(this, rRenderContext);

    if (rRenderContext.IsNativeControlSupported(ControlType::Menubar, ControlPart::Entire))
    {