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

Mac OS X unified title and toolbar broken when using more than one window

    XMLWordPrintable

Details

    • macOS
    • b744d9317153772d431e83aa306cea0faa0dc520

    Description

      This is best explained in a video but I'll summarize here:

      If you create more than one Qt window with a unified title and toolbar, and then send one window into fullscreen mode and back (or even just set unified title and toolbar to false on one of them), the unified title and toolbar will disappear from the other windows when it most certainly should not be affected in any way.

      See video showing the situation here: http://download.petroules.com/videos/toolbar-bug.swf (code seen in the video is attached to this post)

      If you have any questions about the situation post a comment and I'll provide whatever information I can.

      I tested this using Qt 4.7.2, 4.7.3, 4.7.4 and 4.8.0 (master in Git) and all versions are affected. I also tried with 4.7.3/Carbon and the issue seems to only affect Cocoa builds of Qt.

      I expect the issue lies in src/gui/widgets/qmainwindowlayout_mac.mm but my knowledge of Cocoa is very limited so nothing in particular stood out. There's also a comment near the beginning of QMainWindowLayout::insertIntoMacToolbar(QToolBar*, QToolBar*) that I found interesting:

      #if defined(QT_MAC_USE_COCOA)
          // toolbar will now become native (if not already) since we need
          // an nsview for it inside the corresponding NSToolbarItem.
          // Setting isInUnifiedToolbar will (among other things) stop alien
          // siblings from becoming native when this happends since the toolbar
          // will not overlap with other children of the QMainWindow. NB: Switching
          // unified toolbar off after this stage is not supported, as this means
          // that either the menubar must be alien again, or the sibling must
          // be backed by an nsview to protect from overlapping issues:
          toolbar->d_func()->isInUnifiedToolbar = true;
      #endif
      

      "Switching unified toolbar off after this stage is not supported"... I don't know if that is related.

      Attachments

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

        Activity

          People

            jakepetroules Jake Petroules (DO NOT ASSIGN ISSUES)
            jakepetroules Jake Petroules (DO NOT ASSIGN ISSUES)
            Votes:
            7 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes