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

MacOS: untimely "beep" when showMaximized() is called (regression)

    XMLWordPrintable

Details

    • macOS
    • 840a66501776b992623734ee37be0a46ecc42484

    Description

      Run this extremely simple sample on Mac:
      You first see a message box: press OK, and then you see the window... the problem is that when the window shows up, a system "beep" is heard (additionally, the window is not maximized).

      This simple sample is to reproduce a case I have in a big app, where multiple top levels windows are restored (QMainWindow) with restoreGeometry + show(). Some beeps are (sometimes) heard, which puzzle the users!

      Fortunatly, I have found the easy solution to the problem...

      In file qtbase\src\plugins\platforms\cocoa\qcocoawindow.mm
      In method: QCocoaWindow::syncWindowState
      There is the line:

      [m_nsWindow performZoom : m_nsWindow];

      It should be changed to:

      [m_nsWindow zoom : m_nsWindow];

      Note: Qt 4.8 also used "zoom" instead of "performZoom", hence the regression.

      The explanation of the beep can be found in the Apple documentation:
      "If the window doesn’t have a zoom box or can’t be zoomed for some reason, the computer beeps."
      https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/classes/NSWindow_Class/Reference/Reference.html#//apple_ref/occ/instm/NSWindow/performZoom:

      Note that I have absolutly no cue why it is necessary to display a dialog box before the problem happens.

      Attachments

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

        Activity

          People

            sorvig Morten Sørvig
            jirauser26727 user-04d21 (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes