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

[macOS] QCocoaWindow::devicePixelRatio called from scenegraph render thread results in warning

    XMLWordPrintable

Details

    • macOS

    Description

      Cloned / Separated out from QTBUG-113973 as this issue seems to be separate. In short, it seems like the QQuickWindow ends up calling NSView convertSizeToBacking from the wrong thread.

       

      Please see attached project.
      Configure with CMake for Xcode generator, run with Xcode.

      API is supposed to be used from main thread only.

      Main Thread Checker
      /Users/sergei.nevdakh/Qt/6.5.1.universal/qt_src_6.5.1/qtbase/src/plugins/platforms/cocoa/qcocoawindow.mm:1925 -[NSView convertSizeToBacking:] must be used from main thread only
      
      Thread 26
      #0	0x000000010625a98b in QCocoaWindow::devicePixelRatio() const [inlined] at /Users/sergei.nevdakh/Qt/6.5.1.universal/qt_src_6.5.1/qtbase/src/plugins/platforms/cocoa/qcocoawindow.mm:1925
      #1	0x000000010625a97c in non-virtual thunk to QCocoaWindow::devicePixelRatio() const ()
      #2	0x000000010625a97b in non-virtual thunk to QCocoaWindow::devicePixelRatio() const ()
      #3	0x000000010303dea3 in QWindow::devicePixelRatio() const at /Users/sergei.nevdakh/Qt/6.5.1.universal/qt_src_6.5.1/qtbase/src/gui/kernel/qwindow.cpp:1334
      #4	0x00000001043af78f in QQuickWindow::effectiveDevicePixelRatio() const [inlined] ()
      #5	0x00000001043af764 in QQuickWindowPrivate::syncSceneGraph() at /Users/sergei.nevdakh/Qt/6.5.1.universal/qt_src_6.5.1/qtdeclarative/src/quick/items/qquickwindow.cpp:531
      #6	0x00000001043af763 in QQuickWindowPrivate::syncSceneGraph() at /Users/sergei.nevdakh/Qt/6.5.1.universal/qt_src_6.5.1/qtdeclarative/src/quick/items/qquickwindow.cpp:531
      #7	0x0000000104539ddf in QSGRenderThread::sync(bool) at /Users/sergei.nevdakh/Qt/6.5.1.universal/qt_src_6.5.1/qtdeclarative/src/quick/scenegraph/qsgthreadedrenderloop.cpp:550
      #8	0x000000010453a177 in QSGRenderThread::syncAndRender() at /Users/sergei.nevdakh/Qt/6.5.1.universal/qt_src_6.5.1/qtdeclarative/src/quick/scenegraph/qsgthreadedrenderloop.cpp:688
      #9	0x000000010453b1a7 in QSGRenderThread::run() at /Users/sergei.nevdakh/Qt/6.5.1.universal/qt_src_6.5.1/qtdeclarative/src/quick/scenegraph/qsgthreadedrenderloop.cpp:938
      #10	0x000000010664c3a3 in QThreadPrivate::start(void*)::$_0::operator()() const [inlined] at /Users/sergei.nevdakh/Qt/6.5.1.universal/qt_src_6.5.1/qtbase/src/corelib/thread/qthread_unix.cpp:321
      #11	0x000000010664c2a4 in void (anonymous namespace)::terminate_on_exception<QThreadPrivate::start(void*)::$_0>(QThreadPrivate::start(void*)::$_0&&) [inlined] at /Users/sergei.nevdakh/Qt/6.5.1.universal/qt_src_6.5.1/qtbase/src/corelib/thread/qthread_unix.cpp:257
      #12	0x000000010664c2a4 in QThreadPrivate::start(void*) at /Users/sergei.nevdakh/Qt/6.5.1.universal/qt_src_6.5.1/qtbase/src/corelib/thread/qthread_unix.cpp:280
      #13	0x000000010664c2a3 in QThreadPrivate::start(void*) at /Users/sergei.nevdakh/Qt/6.5.1.universal/qt_src_6.5.1/qtbase/src/corelib/thread/qthread_unix.cpp:278
      #14	0x000000010664c2a3 in QThreadPrivate::start(void*) at /Users/sergei.nevdakh/Qt/6.5.1.universal/qt_src_6.5.1/qtbase/src/corelib/thread/qthread_unix.cpp:278
      #15	0x00000001024f955b in _pthread_start ()
      

      Attachments

        1. Screenshot 2023-05-26 at 16.58.51.png
          825 kB
          Michael Bruning
        2. WebEngineProfileUiThread.zip
          2 kB
          Michael Bruning

        Issue Links

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

          Activity

            People

              qt.team.graphics.and.multimedia Qt Graphics Team
              mibrunin Michael Bruning
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes