wrapenum fix the usage of array with enum values
add window_parent_check helper function and implement it