summaryrefslogtreecommitdiff
path: root/vcl/source/control/scrbar.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-06-17 17:02:54 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-06-17 19:08:43 +0200
commitd4714b0fdb81e6e561ae526cc517ecc9a40a603e (patch)
treee02901728616ef7ab881c09c8a4c6b397e6f7a89 /vcl/source/control/scrbar.cxx
parent2be2c914ed48823304c2e95a836ee93a08853628 (diff)
tdf#101978 vcl combobox/listbox floating window: avoid flicker
Regression from commit dca01def7885ad69cf66edd75cf8207a5adb64f9 (refactor ListBox/ComboBox to use RenderContext, 2015-05-07), the problem was that with VCL backends which don't paint on idle, the widget flickered on keyboard / mouse interaction, similar to the Calc autofilter. To avoid side-effects: - Avoid direct paint in ScrollBar::ImplDragThumb(), instead do Invalidate() + Update(), which is the same, but this way dragging the scrollbar with the mouse doesn't fails an assertion (because we tried to paint directly on a double-buffered window). - Only call RequestDoubleBuffering() for backends which don't handle focus themselves (i.e. not for gtk3); to be in sync with the Calc autofilter behavior. Change-Id: Iec9ad2fe9d32efb8da65cc26cf89cc47912bf545 Reviewed-on: https://gerrit.libreoffice.org/74176 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'vcl/source/control/scrbar.cxx')
-rw-r--r--vcl/source/control/scrbar.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx
index 19db246006b7..b20711d5e2f8 100644
--- a/vcl/source/control/scrbar.cxx
+++ b/vcl/source/control/scrbar.cxx
@@ -816,7 +816,13 @@ void ScrollBar::ImplDragThumb( const Point& rMousePos )
// When dragging in windows the repaint request gets starved so dragging
// the scrollbar feels slower than it actually is. Let's force an immediate
// repaint of the scrollbar.
- ImplDraw(*this);
+ if (SupportsDoubleBuffering())
+ {
+ Invalidate();
+ Update();
+ }
+ else
+ ImplDraw(*this);
mnDelta = mnThumbPos-nOldPos;
Scroll();