Merge "Changes window and event flags to new PURPOSE_BUGFIX type." into main