diff --git a/libtaskmanager/tasksmodel.cpp b/libtaskmanager/tasksmodel.cpp --- a/libtaskmanager/tasksmodel.cpp +++ b/libtaskmanager/tasksmodel.cpp @@ -552,8 +552,15 @@ const QModelIndex &concatProxyIndex = concatProxyModel->index(sortedPreFilterRows.at(i), 0); if (appsMatch(concatProxyIndex, idx)) { - sortedPreFilterRows.move(row, i + 1); - moved = true; + // Our sort map contains row indices prior to any filtering, but we don't + // want to sort new tasks in next to siblings we're filtering out higher up + // in the proxy chain, so check in with the filter model. + const QModelIndex &filterProxyIndex = filterProxyModel->mapFromSource(concatProxyIndex); + + if (filterProxyIndex.isValid()) { + sortedPreFilterRows.move(row, i + 1); + moved = true; + } break; }