basctl/source/basicide/baside2b.cxx | 10 +++++----- basctl/source/basicide/linenumberwindow.cxx | 25 ++++++++++--------------- basctl/source/basicide/linenumberwindow.hxx | 2 +- include/vcl/window.hxx | 2 +- 4 files changed, 17 insertions(+), 22 deletions(-)
New commits: commit 42a0f7d838e4360fbb07a49fa310d0d5bc1813b1 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Sat Jun 28 13:14:17 2025 +0500 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Wed Jul 2 08:59:27 2025 +0200 tdf#167277: make LineNumberWindow and BreakPointWindow paint immediately ... on scroll. No idea why did it only show up with Vulkan; but for these windows, the immediate paint is the correct thing to do. The behavior of Paint wrt. SyncYOffset was changed: on invalidation, now it doesn't return from Paint, to avoid flicker (the background of windows is already erased; keeping it white until next paint can be noticed). Change-Id: I5d306122f4465ca4556cd5b8c69d5f047ce9b53f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187131 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> (cherry picked from commit 0a031b751a1b48260c33aa2fffd12dc075d0178d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187140 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index bb29fc1d9bca..d409fae4d8d0 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -1489,8 +1489,7 @@ BreakPointWindow::BreakPointWindow (vcl::Window* pParent, ModulWindow* pModulWin void BreakPointWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) { - if (SyncYOffset()) - return; + SyncYOffset(); // Don't return even if invalidated, to avoid flicker Size const aOutSz = rRenderContext.GetOutputSize(); tools::Long const nLineHeight = rRenderContext.GetTextHeight(); @@ -1542,17 +1541,18 @@ void BreakPointWindow::ShowMarker(vcl::RenderContext& rRenderContext) void BreakPointWindow::DoScroll( tools::Long nVertScroll ) { nCurYOffset -= nVertScroll; - Window::Scroll( 0, nVertScroll ); + Window::Scroll(0, nVertScroll, ScrollFlags::Update); } void BreakPointWindow::SetMarkerPos( sal_uInt16 nLine, bool bError ) { - if ( SyncYOffset() ) - PaintImmediately(); + bool bPaintImmediately = SyncYOffset(); nMarkerPos = nLine; bErrorMarker = bError; Invalidate(); + if (bPaintImmediately) + PaintImmediately(); } void BreakPointWindow::SetNoMarker () diff --git a/basctl/source/basicide/linenumberwindow.cxx b/basctl/source/basicide/linenumberwindow.cxx index 65e02c346acc..abc519d98b31 100644 --- a/basctl/source/basicide/linenumberwindow.cxx +++ b/basctl/source/basicide/linenumberwindow.cxx @@ -43,8 +43,7 @@ void LineNumberWindow::dispose() void LineNumberWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) { - if (SyncYOffset()) - return; + SyncYOffset(); // Don't return even if invalidated, to avoid flicker ExtTextEngine* txtEngine = m_pModulWindow->GetEditEngine(); if (!txtEngine) @@ -139,22 +138,18 @@ void LineNumberWindow::DataChanged(DataChangedEvent const& rDCEvt) void LineNumberWindow::DoScroll(tools::Long nVertScroll) { m_nCurYOffset -= nVertScroll; - Window::Scroll(0, nVertScroll); + Window::Scroll(0, nVertScroll, ScrollFlags::Update); } -bool LineNumberWindow::SyncYOffset() +void LineNumberWindow::SyncYOffset() { - TextView* pView = m_pModulWindow->GetEditView(); - if (!pView) - return false; - - tools::Long nViewYOffset = pView->GetStartDocPos().Y(); - if (m_nCurYOffset == nViewYOffset) - return false; - - m_nCurYOffset = nViewYOffset; - Invalidate(); - return true; + if (TextView* pView = m_pModulWindow->GetEditView()) + { + tools::Long nViewYOffset = pView->GetStartDocPos().Y(); + if (m_nCurYOffset != nViewYOffset) + Invalidate(); + m_nCurYOffset = nViewYOffset; + } } } // namespace basctl diff --git a/basctl/source/basicide/linenumberwindow.hxx b/basctl/source/basicide/linenumberwindow.hxx index 5f5ab744f0f0..43ce0e12f3bb 100644 --- a/basctl/source/basicide/linenumberwindow.hxx +++ b/basctl/source/basicide/linenumberwindow.hxx @@ -36,7 +36,7 @@ public: void DoScroll(tools::Long nVertScroll); - bool SyncYOffset(); + void SyncYOffset(); tools::Long& GetCurYOffset() { return m_nCurYOffset; } int GetWidth() const { return m_nWidth; } diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index c8f4491caa6a..dd826152ee06 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -215,7 +215,7 @@ enum class ScrollFlags Children = 0x0002, NoChildren = 0x0004, UseClipRegion = 0x0008, - Update = 0x0010, + Update = 0x0010, // paint immediately }; namespace o3tl {