diff --git a/docs/changes.txt b/docs/changes.txt index 66bbbf592e..8885427009 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -597,6 +597,7 @@ wxGTK: target window. - Fix crashes in wxGTK3 when running with non-X11 backend (Marco Trevisan). - Fix coordinates of wxSetCursorEvent propagated to parent windows. +- Fix GTK+ warnings when refreshing wxListCtrl items (Scott Talbert). wxMSW: diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 771c400bb4..d21a8c6fae 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -1935,6 +1935,13 @@ void wxListMainWindow::RefreshLines( size_t lineFrom, size_t lineTo ) size_t visibleFrom, visibleTo; GetVisibleLinesRange(&visibleFrom, &visibleTo); + if ( lineFrom > visibleTo || lineTo < visibleFrom ) + { + // None of these lines are currently visible at all, don't bother + // doing anything. + return; + } + if ( lineFrom < visibleFrom ) lineFrom = visibleFrom; if ( lineTo > visibleTo )