// override base control invalidate, and call it, and also pass the invalidate to the gl window control // override this, so that we see all invalidations layouts to us and what child required it. // then we just layout and size the child only, so the rest of them, unaffected by the way displaycontrol handles textures, do not get invalidated // unless we see there is compound docking on, in which case we need to use a full PerformLayout // may be called with null child, meaning its a remove/detach // it may be called due to a property in displaycontrol changing (Font), // and we check the vertex/positions/sizes to make sure everything is okay private protected override void InvalidateLayout(GLBaseControl dueto) { //System.Diagnostics.Debug.WriteLine($"Display control invalidate layout due to {dueto?.Name} {suspendLayoutCount}"); glwin.Invalidate(); int docked = ControlsZ.Where(x => x.Dock >= DockingType.Left).Count(); // how many have a compound docking type if (dueto == this || docked > 0) // if change due to display control property, or we have a docking sitation { PerformLayout(); // full layout on all children } else { if (dueto != null) // if not a remove, layout and size on child only { dueto.PerformLayoutAndSize(); } } UpdateVertexPositionsTextures(); // need to at least update vertexes, maybe textures }