fixed compatibility issues with display.getSize()