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

Performance issue with NSFullSizeContentViewWindowMask flag

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • None
    • 5.10.0
    • QPA
    • None
    • macOS High Sierra (v10.13.2)
      Qt 5.10.0
    • macOS

    Description

      Brief story:

      Usage of the following code snippet leads to severe performance losses in Qt applications.

      window.styleMask |= NSFullSizeContentViewWindowMask;

      Long story:

      I was trying to develop better-looking macOS apps, hence I decided to use native Objective-C codes to get rid of the titlebar of my application with full size content view like below:

      I'm using following method to achive my goal:

      auto mainWindow = new QWindow;
      auto nsView = (NSView*) mainWindow->winId();
      auto window = [nsView window];
      [window setTitlebarAppearsTransparent: YES];
      [window setTitleVisibility: NSWindowTitleHidden];
      [window setAppearance: [NSAppearance appearanceNamed:NSAppearanceNameAqua]];
      window.styleMask |= NSFullSizeContentViewWindowMask; //Problematic line

      Usage of the last line of the code is affecting the general application painting performance. I did a performance compare with a very simple test application (which I've attached below). I have several AnimatedImage objects in my simple qml application to inspect general rendering performance of Qt applications with and without usage of above problematic code.

      Test results

      Before:

      After:

      You can see the CPU usage of the "macforce" app. Cpu load changes from %2.6 to %50.7 with the usage of a single line in the code.

      Attachments

        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
            kozmon Ömer Göktaş
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes