The real code that I’m working on is a series of drawing exercises, where I have one simple API and I’m coming up with many implementations of it. The program that hit this bug is a helper for those exercises that lets me select four nice-looking renderings of each implementation and then save the results to a file. I do this by creating a rectangular window, with space for four selections in the left/center and the current candidate on the right, and use key presses to make the four selections. Once I’m happy with them, I press another key; this resizes the window so it just has enough space for the selected drawings, calls save(), and exits.
In short, my actual program only resizes once, from a keyPressed() callback, and it does so immediately before exiting. If there are better ways of doing it, I’d be happy to hear them, but this didn’t seem too bad to me.