After 7 years I can be forgiven for forgetting my own posts LOL.
For others interested the 2016 discussion provided one answer based on code provided by GoToLoop and myself.
After a googling to find the 2016 post I found this discussion from 2018 where I show a simple safe way for your sketch to detect a change in the width
or height
Hope these provide an insight into the window resize topic.