Qt 5.2.1 fixed some crashes our customers were getting when changing their monitor configuration. However, we are still getting some crashes.
One customer said he was trying to use AirDisplay, which is an iOS app for extending your desktop to an iPhone/iPad. So we tested and confirmed that this was possible.
You can crash our test application (or probably most applications) like this:
- Start AirDisplay Host on your computer and on your iPhone/iPad.
- Start the application.
- Move an application window so it is mostly on the iPhone/iPad display.
- Quit AirDisplay.
The OS does not report the new monitor configuration before it requests a repaint (at least in Qt). So QCocoaScreen::devicePixelRatio() gets called, which calls QCocoaScreen::osScreen(), and this has an invalid index (m_screenIndex) in to the [NSScreen screens]. This raises an exception, and then the application crashes or behaves badly.
I'm not sure if this timing issue ever occurs with regular monitors.
However, AirDisplay is becoming more and more popular, so it may still be an important issue to resolve.