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

[REG] assert "Resulting NSScreen should match the requested NSScreen" can fail

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.12.3
    • None
    • macOS

    Description

      In a larger project (where the bug can be reproduced), I have after several hours not been able to detect the missing piece in the attached example (that may not fail - where it in the larger project fails first time and always)

      The failing assert is in qcocoawindow.mm  

      QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBePanel)
      {
      ..
      Q_ASSERT_X(nsWindow.screen == cocoaScreen->nativeScreen(), "QCocoaWindow", "Resulting NSScreen should match the requested NSScreen"); 
      

      A part of the reason is that topleft is outside any screen (after restoreGeometry). The main-window is placed on the secondary screen where restore also should take place.

      (I do wonder why only top left is checked - wouldn't it be an idea to search for most overlapping screen in case top left doesn't match anything?)

      Again, I cannot explain the difference the example code and the larger project code, but the main variables frame, stylemask, flags seem to be set similar and the system is the same.

      When running in release mode the dialog shows up, so maybe a warning could also be sufficient rather than crashing the application on debug.

       

      Attachments

        1. qtdiag.txt
          6 kB
        2. similar_code.zip
          3 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vestbo Tor Arne Vestbø
            tmartsum Thorbjørn Lund Martsum
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes