Handle window size updates correctly