After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 775153 - main-view: Forget the last non-range selection once we unset the selection mode
main-view: Forget the last non-range selection once we unset the selection mode
Status: RESOLVED FIXED
Product: libgd
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: libgd maintainer(s)
libgd maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-11-26 18:23 UTC by Debarshi Ray
Modified: 2016-11-27 14:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
main-view: Forget the last non-range selection when leaving the mode (1.02 KB, patch)
2016-11-26 18:28 UTC, Debarshi Ray
committed Details | Review

Description Debarshi Ray 2016-11-26 18:23:20 UTC
The last_selected_id variable was introduced in the following commit:

commit b82e4c3722f4e83b429d9b72a9a20172fe3a7cd9
Author: Alexander Larsson <alexl@redhat.com>
Date:   Thu Apr 11 11:19:14 2013 +0200

    Make multi range selection work right
    
    When you range select you want the range to start from the last
    single selection you made, not from some random selected item. For instance
    If you first select item 3-5 and then 9-7 you want 7,8,9 selected
    not (like now) 6,7.
    
    We keep the column id of the last item we initially selected (i.e. no
    range select). If this item disappears or something we fall back on the
    old code.
    
    We can also simplify the selection_mode_select_range code a bit
    now that selection_mode_do_select_range handles ranges in any order.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=697645

As described above, if we select 3, 5 and 9, and then shift+select 7, we want 9, 8, 7 to be selected. But if we unset the selection mode, come back and shift+select 1, we don't want everything to get selected. The selection history should not survive across multiple selection mode sessions.
Comment 1 Debarshi Ray 2016-11-26 18:28:35 UTC
Created attachment 340809 [details] [review]
main-view: Forget the last non-range selection when leaving the mode
Comment 2 Debarshi Ray 2016-11-27 14:04:23 UTC
Comment on attachment 340809 [details] [review]
main-view: Forget the last non-range selection when leaving the mode

Pushed after a one-on-one review from Cosimo at the core apps hackfest.