add resize hook and capture idle event