diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 5c7bb48a71..d229958c0f 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -4092,6 +4092,12 @@ void wxListMainWindow::DeleteItem( long lindex ) m_dirty = true; RefreshAfter(index); + + // This might be a wxGTK bug, but when deleting the last item in a control + // with many items, the vertical scroll position may change so that the new + // last item is not visible any longer, which is very annoying from the + // user point of view. Ensure that whatever happens, this item is visible. + EnsureVisible(m_current); } void wxListMainWindow::DeleteColumn( int col )