Ignore:
Timestamp:
Mar 8, 2010, 12:52:58 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.2 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/kernel/qwidget_mac.mm

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    111111#include "qdnd_p.h"
    112112#include <QtGui/qgraphicsproxywidget.h>
     113#include "qmainwindow.h"
    113114
    114115QT_BEGIN_NAMESPACE
     
    404405    qt_mac_app_fullscreen = b;
    405406    if (b) {
    406         SetSystemUIMode(kUIModeAllSuppressed, 0);
     407        SetSystemUIMode(kUIModeAllHidden, kUIOptionAutoShowMenuBar);
    407408    } else {
    408409        SetSystemUIMode(kUIModeNormal, 0);
     
    17221723{
    17231724    Q_Q(QWidget);
     1725#if !defined(QT_NO_MAINWINDOW) && !defined(QT_NO_TOOLBAR)
     1726    // Make sure that QMainWindow has the MacWindowToolBarButtonHint when the
     1727    // unifiedTitleAndToolBarOnMac property is ON. This is to avoid reentry of
     1728    // setParent() triggered by the QToolBar::event(QEvent::ParentChange).
     1729    QMainWindow *mainWindow = qobject_cast<QMainWindow *>(q);
     1730    if (mainWindow && mainWindow->unifiedTitleAndToolBarOnMac()) {
     1731        data.window_flags |= Qt::MacWindowToolBarButtonHint;
     1732    }
     1733#endif
    17241734#ifndef QT_MAC_USE_COCOA
    17251735// ### COCOA:Interleave these better!
     
    27442754        if (wasWindow) {
    27452755            oldToolbar = [oldWindow toolbar];
     2756            [oldToolbar retain];
    27462757            oldToolbarVisible = [oldToolbar isVisible];
     2758            [oldWindow setToolbar:nil];
    27472759        }
    27482760#endif
     
    27882800                OSWindowRef newWindow = qt_mac_window_for(q);
    27892801                [newWindow setToolbar:oldToolbar];
     2802                [oldToolbar release];
    27902803                [oldToolbar setVisible:oldToolbarVisible];
    27912804            }
     
    34023415#else
    34033416            [window orderOut:window];
     3417            // Unfortunately it is not as easy as just hiding the window, we need
     3418            // to find out if we were in full screen mode. If we were and this is
     3419            // the last window in full screen mode then we need to unset the full screen
     3420            // mode. If this is not the last visible window in full screen mode then we
     3421            // don't change the full screen mode.
     3422            if(q->isFullScreen())
     3423            {
     3424                bool keepFullScreen = false;
     3425                QWidgetList windowList = qApp->topLevelWidgets();
     3426                int windowCount = windowList.count();
     3427                for(int i = 0; i < windowCount; i++)
     3428                {
     3429                    QWidget *w = windowList[i];
     3430                    // If it is the same window, we don't need to check :-)
     3431                    if(q == w)
     3432                        continue;
     3433                    // If they are not visible or if they are minimized then
     3434                    // we just ignore them.
     3435                    if(!w->isVisible() || w->isMinimized())
     3436                        continue;
     3437                    // Is it full screen?
     3438                    // Notice that if there is one window in full screen mode then we
     3439                    // cannot switch the full screen mode off, therefore we just abort.
     3440                    if(w->isFullScreen()) {
     3441                        keepFullScreen = true;
     3442                        break;
     3443                    }
     3444                }
     3445                // No windows in full screen mode, so let just unset that flag.
     3446                if(!keepFullScreen)
     3447                    qt_mac_set_fullscreen_mode(false);
     3448            }
    34043449#endif
    34053450            toggleDrawers(false);
     
    36723717
    36733718#if QT_MAC_USE_COCOA
     3719    QMacCocoaAutoReleasePool pool;
    36743720    if (isRealWindow()) {
    36753721        // Calling orderFront shows the window on Cocoa too.
Note: See TracChangeset for help on using the changeset viewer.