Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-77656

Crash when waking up with multiple displays in clamshell mode



    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: 5.13.0
    • Fix Version/s: 5.14.0 RC1
    • Component/s: GUI: Window management
    • Labels:
    • Environment:
      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


      (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.


          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.



              • Assignee:
                vestbo Tor Arne Vestbø
                knopp Matej Knopp
              • Votes:
                2 Vote for this issue
                5 Start watching this issue


                • Created:

                  Gerrit Reviews

                  There are no open Gerrit changes