Unify code to get access to the current X11 display