vcl/source/control/listbox.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
New commits: commit 427371814dc96ae7798a607de5eb9565d7a023f0 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu Oct 3 20:52:25 2024 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Oct 4 00:40:50 2024 +0200 tdf#163225 vcl: Erase listbox bg when redrawing on mouse move Somehow, moving the listbox invalidation code from ImplWin::PreNotify to ListBox::PreNotify in commit fd7cb42f7d17d03e4fac6d8c5f1d6c7c49a36fc6 Author: Michael Weghorn <m.wegh...@posteo.de> Date: Tue Feb 14 16:16:30 2023 +0100 tdf#153520 vcl: Align listbox invalidation with mouseover check triggered rendering artifacts for the tdf#163225 listbox example. It seems that the previous rendering operation apparently seems a pixel or so off from the current one and as the InvalidateFlags::NoErase flag gets passed, what was drawn previously is not erased. Don't pass that flag any more to ensure that the background is properly erased, which fixes the rendering artifacts. The flag's docmentation says: /** The invalidated area is painted with the background color/pattern. */ NoErase = 0x0004, Dropping the flag doesn't negatively affect drawing a listbox that has an explicit background color set in my tests, s. modified sample document attachment 196871 in tdf#163225 . Stop passing that flag in ListBox::StateChanged, too. Change-Id: Ibcacbed01888449db062f84b4782feb9de69851c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174438 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx index 81e9eafdc33e..beaa0cc19c06 100644 --- a/vcl/source/control/listbox.cxx +++ b/vcl/source/control/listbox.cxx @@ -721,7 +721,7 @@ void ListBox::StateChanged( StateChangedType nType ) if ( IsNativeControlSupported(ControlType::Listbox, ControlPart::Entire) && ! IsNativeControlSupported(ControlType::Listbox, ControlPart::ButtonDown) ) { - GetWindow( GetWindowType::Border )->Invalidate( InvalidateFlags::NoErase ); + GetWindow(GetWindowType::Border)->Invalidate(); } else mpImplWin->Invalidate(); @@ -894,7 +894,7 @@ bool ListBox::PreNotify( NotifyEvent& rNEvt ) if (IsNativeControlSupported(ControlType::Listbox, ControlPart::Entire) && !IsNativeControlSupported(ControlType::Listbox, ControlPart::ButtonDown)) { - GetWindow(GetWindowType::Border)->Invalidate(InvalidateFlags::NoErase); + GetWindow(GetWindowType::Border)->Invalidate(); } } }