Merge "Changes order of events processing for new layouting." into devel/master