Fix passing of display/window pointers