pull request

Dirk Hohndel dirk at Hohndel.org
Sun Aug 19 12:21:08 PDT 2012


Yep. And I think I can tell that we are being called while expanded and therefore adjust the tracking logic.
Basically, if we are expanded and the whole group is selected, don't manually unselect the children.

/D

Linus Torvalds <torvalds at linux-foundation.org> wrote:

>On Sun, Aug 19, 2012 at 11:52 AM, Dirk Hohndel <dirk at hohndel.org>
>wrote:
>> Yes, I think I know what's going on.
>
>I think I do too.
>
>I *think* the problem is introduced by the fact that you change the
>selection by hand when the group is selected, so what happens is:
>
> - gtk tells you that the group is selected: you as a result
>recursively select all the children.
>
> - gtk *also* tells you that the children are selected (because it's
>expanded and you shift-clicked, so gtk wants to select everything in
>between), but you've already selected the children, so now when you
>get that callback, you *unselect* them because that's how you react to
>the "selection change" signal.
>
>Or something like that.
>
>I get the feeling that we're a bit screwed, because I don't see that
>we have any way to control the order that gtk sends that "change"
>callback to us. In fact, the documentation states that the "change"
>callback can happen even if no change really happened, and I think
>that's why one of the entries stays selected in the end: the debug
>output shows that the shift-select click results in
>
>
>  modify_selection_cb with idx 234 (according to gtk was selected)
>  remove 234 from selection of 2 entries
>  removed 234 at pos 0 and decreased amount_selected to 1
>  currently selected are 233
>  modify_selection_cb with idx 233 (according to gtk was selected)
>  remove 233 from selection of 1 entries
>  removed 233 at pos 0 and decreased amount_selected to 0
>  currently selected are
>  modify_selection_cb with idx -1 (according to gtk was selected)
>  modify_selection_cb with idx 233 (according to gtk was unselected)
>  add 233 to selection of 0 entries
>  increased amount_selected to 1
>  currently selected are 233
>  modify_selection_cb with idx -1 (according to gtk was unselected)
>  modify_selection_cb with idx 232 (according to gtk was unselected)
>  add 232 to selection of 1 entries
>  increased amount_selected to 2
>  currently selected are 233 232
>  modify_selection_cb with idx 231 (according to gtk was unselected)
>  add 231 to selection of 2 entries
>  increased amount_selected to 3
>  currently selected are 233 232 231
>
>(notice how 233 showed up *twice*)
>
>           Linus

-- 
Sent from my phone.
Please excuse my brevity and text prediction errors


More information about the subsurface mailing list