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

Crash when waking up with multiple displays in clamshell mode

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.14.0 RC1, 6.1.3
    • 5.13.0
    • GUI: Window management
    • 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

          For Gerrit Dashboard: QTBUG-77656
          # Subject Branch Project Status CR V

          Activity

            People

              vestbo Tor Arne Vestbø
              knopp Matej Knopp
              Votes:
              2 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews