From 5ccdce11680528d1e993bffe2cae8417b5aba8c8 Mon Sep 17 00:00:00 2001 From: Méven Car Date: Sat, 13 Jun 2026 15:24:49 +0000 Subject: smoothscroller: always emit scrollingStopped from scrollTo When scrollTo() is asked to move to the position the scrollbar already holds (clamped, e.g. an item at the bottom, or a sub-pixel offset), no animation runs and scrollingStopped() was never emitted. Callers waiting for it stayed blocked: KItemListView::scrollToItem() delegates to scrollTo for any non-zero offset, and DolphinView::renameSelectedItems() only opens the inline rename editor once scrollingStopped() arrives. So inline rename silently did nothing for the affected items. Emit scrollingStopped() in the no-op case too, and add a regression test. --- src/kitemviews/private/kitemlistsmoothscroller.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/kitemviews/private') diff --git a/src/kitemviews/private/kitemlistsmoothscroller.cpp b/src/kitemviews/private/kitemlistsmoothscroller.cpp index 7cedf9d94..dc7db23d6 100644 --- a/src/kitemviews/private/kitemlistsmoothscroller.cpp +++ b/src/kitemviews/private/kitemlistsmoothscroller.cpp @@ -136,6 +136,12 @@ void KItemListSmoothScroller::scrollTo(qreal position) if (newValue != m_scrollBar->value()) { m_smoothScrolling = true; m_scrollBar->setValue(newValue); + } else { + // The target position is the one we are already at, so no animation will + // run and slotAnimationStateChanged() will not emit scrollingStopped(). + // Emit it here so callers waiting for the view to settle (e.g. inline + // rename via KItemListView::scrollToItem()) are not left hanging. + Q_EMIT scrollingStopped(); } } -- cgit v1.3.1