diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-08-22 17:30:43 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-08-22 20:40:01 +0200 |
commit | d5c7657c541c1f6d17bfe5e605594c235eecfcdb (patch) | |
tree | 251a2e9962dc632d608b4141b162fbdc6dda94f7 /sfx2 | |
parent | 055c249847548a5c28ab5b29f3603ffbe74fe1f0 (diff) |
tdf#71087 sfx2: avoid flicker in the start center
There were a couple of problems here:
1) BackingWindow now does double-buffering to avoid flicker when e.g.
navigating with the keyboard in sfx2::RecentDocsView
2) But then the menu background turned into white (instead of the
gradient), so MenuBarWindow needs to differentiate between doing its own
buffering vs painting into a buffer.
3) The focus rectangles were always painted directly, so keyboard
navigation in the startcenter lost focus rectangles, making it hard to
see which button is active currently. Fix this by explicitly painting a
tracking rectangle in PushButton::ImplDrawPushButton().
This brings an improvement for the Windows GDI and Linux gen backends.
Windows GL and Linux gtk3 is meant to be unchanged, they were already
flicker-free here.
Change-Id: Ib01e330c244c2b38a5b5c52399692e19ff811de3
Reviewed-on: https://gerrit.libreoffice.org/77969
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/backingcomp.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sfx2/source/dialog/backingcomp.cxx b/sfx2/source/dialog/backingcomp.cxx index 1de9a2daa698..a810f0be9fda 100644 --- a/sfx2/source/dialog/backingcomp.cxx +++ b/sfx2/source/dialog/backingcomp.cxx @@ -576,6 +576,12 @@ 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(); } @@ -660,6 +666,10 @@ 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()) |