ContactFilter.shouldCollide() isn't called when I expect....

The essence of the situation: There are two overlapping shapes; I want one to be "ethereal" in some sense. So I want the shapes to slide freely through one another. I allow this by returning false from shouldCollide(). But I want the "ethereal" shape to become "solid" when it stops overlapping the other shape. A custom ContactListener handles this--it changes something when the contact is removed, so that ContactFilter.shouldCollide() (which also has a custom implementation) will return true if it's called at any time after the two shapes have slid apart. So far, so good.

Here's the problem: Sometimes the shapes separate, so I want them to start colliding, but they don't separate far enough for their bounding boxes to separate. When they slide back together, they don't collide even though I want them to collide. Although shouldCollide()'s result changed, that didn't matter because shouldCollide() was never called.

If the shapes slide far apart and come back together, shouldCollide() is called when I expect, and my plan works.

How can I achieve the behavior I want, even when the shapes only separate slightly, with their bounding boxes still touching? (I think the bounding boxes are involved, anyway. I haven't proved it, but I've seen evidence of it.) I've tried making the "ethereal" shape a sensor, rather than relying on shouldCollide(), and then turning it into a non-sensor when it stops contacting the other shape. But that produces the same problem. The change in Shape.m_isSensor has no effect unless the bounding boxes separate. It's not good enough for the shapes to separate.

I'm sure I could hack around the problem if I tried, but it'd probably be ugly... if shouldCollide() were called every time the shapes were about to touch, and not just when their bounding boxes were about to touch, my program would work perfectly! Is there a nice way to achieve something like this?
try this (probably will work):
use the Distance class to see how far apart they are while sliding across eachother, as soon as the distance >= 0 then turn collisions on.
I don't understand. Contacts are already being added and removed when the shapes stop or start touching. My ContactListener picks that up. So I don't need Distance to learn that. And I don't know how to "turn collisions on", except by changing the result of shouldCollide() or by changing isSensor (and neither of those strategies work in the case described above).
I'm really not sure, I think the next version handles this differently though, based on the demos it seems like what you're looking for will be easier to implement.

Original thread: https://box2d.org/forum/viewtopic.php?t=4788