diff --git a/qt/details.cc b/qt/details.cc
index cd6a28bdc..7bd8785b0 100644
--- a/qt/details.cc
+++ b/qt/details.cc
@@ -710,6 +710,7 @@ Details :: refresh( )
         myPeerLimitSpin->blockSignals( false );
     }
 
+    if( !torrents.empty( ) )
     {
         const Torrent * tor;
 
diff --git a/qt/mainwin.cc b/qt/mainwin.cc
index dd59e2286..69288bfdb 100644
--- a/qt/mainwin.cc
+++ b/qt/mainwin.cc
@@ -967,12 +967,19 @@ TrMainWindow :: refreshPref( int key )
             refreshTrayIcon( );
             break;
 
-        case Prefs::COMPACT_VIEW:
+        case Prefs::COMPACT_VIEW: {
+            QItemSelectionModel * selectionModel( ui.listView->selectionModel( ) );
+            const QItemSelection selection( selectionModel->selection( ) );
+            const QModelIndex currentIndex( selectionModel->currentIndex( ) );
             b = myPrefs.getBool( key );
             ui.action_CompactView->setChecked( b );
             ui.listView->setItemDelegate( b ? myTorrentDelegateMin : myTorrentDelegate );
+            selectionModel->clear( );
             ui.listView->reset( ); // force the rows to resize
+            selectionModel->select( selection, QItemSelectionModel::Select );
+            selectionModel->setCurrentIndex( currentIndex, QItemSelectionModel::NoUpdate );
             break;
+        }
 
         case Prefs::MAIN_WINDOW_X:
         case Prefs::MAIN_WINDOW_Y: