[PATCH] Select all dives in a trip when said trip is expanded and clicked

Dirk Hohndel dirk at hohndel.org
Mon Feb 18 11:02:42 PST 2013


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

> On Mon, Feb 18, 2013 at 10:35 AM, Linus Torvalds
> <torvalds at linux-foundation.org> wrote:
>>
>> I'm not understanding why you do thegtk_tree_view_row_expanded on each
>> iteration.
>
> Oh, ok, I see it. You intentionally break the whole "if the trip is
> expanded, just rely on gtk selection", and you want to select the
> dives when you select the trip by hand but not the dives.
>
> And no, we cannot do this. I know we *used* to do it, but it was
> buggy.  When the dives are exposed, we have to let the gtk selection
> just work, because not doing that screws things up.
>
> So right now, if the trip is expanded, and you want to select the
> children, you have to actually do that with the mouse. Exactly because
> of the whole "messing with what gtk already knows about the selection
> doesn't really work".
>
> It's annoying, yes. But the alternative was to have random SIGSEGV's.
>
> You can *possibly* do this by creating a list of the selected trips,
> and after letting the gtk selection work, iterate over that list.
> That's close to what we used to do, but we did it from the "selection
> will change" callback, and that didn't work because you then need to
> wait to use it until after the selection is done, and in the meantime
> there might have been a callback that removed some entry (this was why
> we got SIGSEGV's on OS X - apparently gtk just happens to be robust
> for this on X11, but not with the Quartz backend)

Which begs the question "is there a fix for the issue that we know
about when you click on an expanded trip?

Basically what happens is that Gtk shows only the trip as selected, not
the children. Our notion of how many dives are selected (that you can
see in the stats notebook which shows you amount_selected) stays the
same, yet our notion of the selected_dive goes away (profile goes
blank).

The moment you collapse the trip and THEN click on it, all works as
expected.

I find this one truly annoying :-(

/D


More information about the subsurface mailing list