tdf#101086 sc autofilter popup: avoid flicker

Regression from commit a4cb27f61376d8f2d8faed0022c291af68d437bd
(refactor ScMenuFloatingWindow to use RenderContext, 2015-05-14), the
problem was that the change had two effects:

1) It removed incremental rendering that now causes flicker.

2) It added support for painting into a rendercontext, not on the window
itself.

Given that here a hierarchy of widgets have to be painted at once (to
avoid flicker), use vcl::Window::RequestDoubleBuffering() instead of the
much simpler vcl::BufferDevice.

This improves the situation on Windows, but explicitly blacklist the
focus rectangle case (gtk3) which is currently not compatible with this
higher level double-buffering (and there we already have lower-level
double-buffering anyway, similar to OpenGL).

Change-Id: I77aa951e14db668166dc8757e36c037ee98243bf
Reviewed-on: https://gerrit.libreoffice.org/73441
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index e735ad6..8383738 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -1164,6 +1164,9 @@
    if (!pEntry)
        return;
    maChecks->CheckEntry(pEntry, bSet );

    // Make sure all checkboxes are invalidated.
    Invalidate();
}

IMPL_LINK( ScCheckListMenuWindow, ButtonHdl, Button*, pBtn, void )
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index ea51223..e043cfc 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -645,6 +645,12 @@

    mpAutoFilterPopup.disposeAndClear();
    mpAutoFilterPopup.reset(VclPtr<ScCheckListMenuWindow>::Create(this, pDoc));

    // Avoid flicker when hovering over the menu items.
    if (!IsNativeControlSupported(ControlType::Pushbutton, ControlPart::Focus))
        // If NWF renders the focus rects itself, that breaks double-buffering.
        mpAutoFilterPopup->RequestDoubleBuffering(true);

    if (comphelper::LibreOfficeKit::isActive())
        mpAutoFilterPopup->SetLOKNotifier(SfxViewShell::Current());
    mpAutoFilterPopup->setOKAction(new AutoFilterAction(this, AutoFilterMode::Normal));