Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

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

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    203203                                                   & ~Qt::WindowMaximized));
    204204        qt_sendSpontaneousEvent(qwidget, &e);
     205
     206
     207
     208
     209
    205210    }
    206211    NSRect rect = [[window contentView] frame];
     
    270275    QWidget *qwidget = m_windowHash->value([notification object]);
    271276    Q_ASSERT(qwidget);
    272     if (qwidget->isActiveWindow())
    273         return;  // Widget is already active, no need to go through re-activation.
    274 
    275277    onApplicationWindowChangedActivation(qwidget, true);
    276278}
     
    289291    QWidget *qwidget = m_windowHash->value([notification object]);
    290292    Q_ASSERT(qwidget);
    291     if (qwidget->isActiveWindow())
    292         return;  // Widget is already active, no need to go through re-activation
    293 
    294 
    295293    onApplicationWindowChangedActivation(qwidget, true);
    296294}
     
    313311    // saving the current window geometry before the window is maximized
    314312    QWidget *qwidget = m_windowHash->value(window);
    315     if (qwidget->isWindow() && !(qwidget->windowState() & Qt::WindowMaximized)) {
    316         QWidgetPrivate *widgetPrivate = qt_widget_private(qwidget);
    317         widgetPrivate->topData()->normalGeometry = qwidget->geometry();
     313    QWidgetPrivate *widgetPrivate = qt_widget_private(qwidget);
     314    if (qwidget->isWindow()) {
     315        if(qwidget->windowState() & Qt::WindowMaximized) {
     316            // Restoring
     317            widgetPrivate->topData()->wasMaximized = false;
     318        } else {
     319            // Maximizing
     320            widgetPrivate->topData()->normalGeometry = qwidget->geometry();
     321            // If the window was maximized we need to update the coordinates since now it will start at 0,0.
     322            // We do this in a special field that is only used when not restoring but manually resizing the window.
     323            // Since the coordinates are fixed we just set a boolean flag.
     324            widgetPrivate->topData()->wasMaximized = true;
     325        }
    318326    }
    319327    return YES;
     
    387395    return NO;
    388396}
     397
     398
     399
     400
     401
     402
     403
     404
     405
     406
     407
     408
     409
     410
     411
     412
     413
     414
     415
     416
    389417@end
    390418#endif// QT_MAC_USE_COCOA
Note: See TracChangeset for help on using the changeset viewer.