Ok, I have now a better understanding of what your exact problem is. It
strikes me that I never ran into this. I tested it by putting some of
my own data structure stuff into GOP subpatches and putting those into
other subpatches. It doesn't happen with the patches I tried.
it's also the first time I notice it. maybe it has something to do that these scalars come from different templates (structs).
Are you sure it's a z-ordering problem at all? I'm not saying that it
isn't, but your patch illustrates that the arrays are not visible after
opening the subpatch and that sending 'background <clr>' helps, which
*could* be a z-ordering problem, but also something totally unrelated.
in this case it surely doesn't have anything to do with z-order, as anyway scalars are redrawn (and go to the front) when something in them is edited.
sending the background message (as well as some others I prepared) only corrects the problem, because the patch rewrites a value from the scalars, so that they come to the front - it's not an "automatic" pd reaction.
Have you tried to boil down an example patch that is much simpler, but
still exhibits the problem?
it would surely help, but I'm not sure when I would have the time for it. I started doing one, but then it didn't work immediately, so I put this one instead.