Changeset 846 for trunk/src/gui/kernel/qcocoawindowdelegate_mac.mm
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/kernel/qcocoawindowdelegate_mac.mm
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 203 203 & ~Qt::WindowMaximized)); 204 204 qt_sendSpontaneousEvent(qwidget, &e); 205 } else { 206 widgetData->window_state = widgetData->window_state & ~Qt::WindowMaximized; 207 QWindowStateChangeEvent e(Qt::WindowStates(widgetData->window_state 208 | Qt::WindowMaximized)); 209 qt_sendSpontaneousEvent(qwidget, &e); 205 210 } 206 211 NSRect rect = [[window contentView] frame]; … … 270 275 QWidget *qwidget = m_windowHash->value([notification object]); 271 276 Q_ASSERT(qwidget); 272 if (qwidget->isActiveWindow())273 return; // Widget is already active, no need to go through re-activation.274 275 277 onApplicationWindowChangedActivation(qwidget, true); 276 278 } … … 289 291 QWidget *qwidget = m_windowHash->value([notification object]); 290 292 Q_ASSERT(qwidget); 291 if (qwidget->isActiveWindow())292 return; // Widget is already active, no need to go through re-activation293 294 295 293 onApplicationWindowChangedActivation(qwidget, true); 296 294 } … … 313 311 // saving the current window geometry before the window is maximized 314 312 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 } 318 326 } 319 327 return YES; … … 387 395 return NO; 388 396 } 397 398 - (void)syncContentViewFrame: (NSNotification *)notification 399 { 400 NSView *cView = [notification object]; 401 if (cView) { 402 NSWindow *window = [cView window]; 403 QWidget *qwidget = m_windowHash->value(window); 404 if (qwidget) { 405 QWidgetData *widgetData = qt_qwidget_data(qwidget); 406 NSRect rect = [cView frame]; 407 const QSize newSize(rect.size.width, rect.size.height); 408 const QSize &oldSize = widgetData->crect.size(); 409 if (newSize != oldSize) { 410 [self syncSizeForWidget:qwidget toSize:newSize fromSize:oldSize]; 411 } 412 } 413 414 } 415 } 416 389 417 @end 390 418 #endif// QT_MAC_USE_COCOA
Note:
See TracChangeset
for help on using the changeset viewer.