GNOME Bugzilla – Bug 734006
GtkListBox: GTK_SELECTION_MULTIPLE broken for mouse clicks
Last modified: 2014-08-03 08:18:57 UTC
Created attachment 282108 [details] testcase With GTK_SELECTION_MULTIPLE, clicking on a row with the mouse only adds the row to the selection; if the row is already selected, it won't be unselected (even when holding down Ctrl while clicking), which is what one would expect, I guess. Also, selecting ranges with Shift+LMB doesn't work. In comparison, when navigating with the arrow keys while holding Ctrl and using Space, one can select and unselect any row (and row ranges) without trouble.
Setting gtk_list_box_set_activate_on_single_click (GTK_LIST_BOX (lb), FALSE); fixes this partly, as it allows to unselect rows with Ctrl+Click, but I'm not sure if this should be necessary. Wouldn't it be better if this selection could be a simple click to select/unselect? (Thinking of all the modal selection modes in many apps now).
I just had a look at this and found that the if clause here happily ignores the modify and extend variables from the else clause below. Not sure how to fix this properly though. (I also don't see how gtk_list_box_select_and_activate() is useful in its current form, since it also ignores the current selection mode). https://git.gnome.org/browse/gtk+/tree/gtk/gtklistbox.c#n1798
(In reply to comment #2) > (I also don't see how gtk_list_box_select_and_activate() > is useful in its current form, since it also ignores the current selection > mode). OK, this wasn't correct, since gtk_list_box_select_row_internal() in turn does take the selection mode into account but the Ctrl and Shift modifiers get lost anyway on the way to there.
*** This bug has been marked as a duplicate of bug 733108 ***