Fix bug #3321 → revert "Remove unreachable code"
[claws.git] / src / gtk / gtkcmclist.c
index 7980b8a2469d184c4f18055461d12ac61b743671..b2807586ed2cdde08ba8bad59590d66d3e808363 100644 (file)
@@ -7035,8 +7035,16 @@ scroll_vertical (GtkCMCList      *clist,
       move_focus_row (clist, scroll_type, position);
 
       if (old_focus_row != clist->focus_row)
-         g_signal_emit (G_OBJECT (clist), clist_signals[UNSELECT_ROW], 0,
-                               old_focus_row, -1, NULL);
+       {
+         if (clist->selection_mode == GTK_SELECTION_BROWSE)
+           g_signal_emit (G_OBJECT (clist), clist_signals[UNSELECT_ROW], 0,
+                            old_focus_row, -1, NULL);
+         else if (!GTK_CMCLIST_ADD_MODE(clist))
+           {
+             gtk_cmclist_unselect_all (clist);
+             clist->undo_anchor = old_focus_row;
+           }
+       }
 
       switch (gtk_cmclist_row_is_visible (clist, clist->focus_row))
        {