Fix bug #3321 → revert "Remove unreachable code"
authorRicardo Mones <ricardo@mones.org>
Tue, 4 Nov 2014 15:48:06 +0000 (16:48 +0100)
committerRicardo Mones <ricardo@mones.org>
Tue, 4 Nov 2014 15:48:06 +0000 (16:48 +0100)
This reverts commit 8090f02e4d5c41be4325f0a13d6b0d98ca03684b.
Many thanks to Andreas Rönnquist for the enlightenment!

src/gtk/gtkcmclist.c

index 7980b8a..b280758 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))
        {