Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.2.1
-
Max OS 10.9.2
-
-
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.