Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.13.0
-
None
-
MacBook Pro 13" 2018 4xTB
macOS Catalina 10.15 Beta (19A526h)
Displays: 2 x LG 24UD58-B (4K)
Sonnet Thunderbolt 3 to Dual DisplayPort Adapter
Description
(sidenote: this setup is a little bit quirky, sometimes during waking up one of the displays wakes up as 1080p (or 4K@30Hz), requires turning it off/on and switching resolution. Still, none of these should cause crashes and assertions).
The problem seems to be new code in qcocoascreen.mm; The callback registered through CGDisplayRegisterReconfigurationCallback is fired with events in order Qt can't handle properly.
Also Qt makes assumptions that seems not to be true:
For example the callback is invoked with displayId == 4128830 and flags == 4368 (kCGDisplayAddFlag, kCGDisplayEnabledFlag, kCGDisplayDesktopShapeChangedFlag), so Qt assumes CGDisplayCreateUUIDFromDisplayID will return valid value (to match displayId with NSScreen), but in my case CGDisplayCreateUUIDFromDisplayID(4128830) returns null despite callback being called with added/enabled flags. This causes assertion in QCocoaScreen::updateProperties()
Also note that in this situation, there are two [NSScreen screens] present, but neither deviceDescription->NSScreenNumber matches the displayId;
Edit: Attached a workaround patch I'm testing right now that seems to solve the assertions and crashes in this case. While not a proper solution, It still might be helpful.
Attachments
Issue Links
- relates to
-
QTCREATORBUG-23211 Qt Creator crash when macOS goes to sleep.
- Closed
-
QTBUG-79633 Application crashes when Mac returns from sleep
- Closed
-
QTCREATORBUG-21614 Occasional crashes when changing screen configuration
- Closed