Avoid wrong positioned dialog for a few milliseconds