diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-08-03 11:33:34 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-08-03 11:33:34 (GMT) |
commit | 5e05bafa229b645bf30a90975bfc57e458e081e5 (patch) | |
tree | 54606401f955891574cbcc589ae2558cb2a5b748 /src/gui/kernel/qapplication_mac.mm | |
parent | 128717b171f01c82e5f0fb83f5923d4f7b9cfc10 (diff) | |
parent | 463df7e4a6dc7c11716e27ca5de9ebeb61940990 (diff) | |
download | Qt-5e05bafa229b645bf30a90975bfc57e458e081e5.zip Qt-5e05bafa229b645bf30a90975bfc57e458e081e5.tar.gz Qt-5e05bafa229b645bf30a90975bfc57e458e081e5.tar.bz2 |
Merge branch '4.5'
Conflicts:
src/corelib/tools/qsharedpointer.cpp
src/corelib/tools/qsharedpointer_impl.h
src/gui/dialogs/qcolordialog.cpp
src/gui/painting/qwindowsurface_raster.cpp
src/network/access/qnetworkaccessmanager.cpp
tests/auto/qsharedpointer/externaltests.cpp
Diffstat (limited to 'src/gui/kernel/qapplication_mac.mm')
-rw-r--r-- | src/gui/kernel/qapplication_mac.mm | 49 |
1 files changed, 12 insertions, 37 deletions
diff --git a/src/gui/kernel/qapplication_mac.mm b/src/gui/kernel/qapplication_mac.mm index beccfb0..ac132aa 100644 --- a/src/gui/kernel/qapplication_mac.mm +++ b/src/gui/kernel/qapplication_mac.mm @@ -1480,6 +1480,7 @@ QWidget *QApplicationPrivate::tryModalHelper_sys(QWidget *top) return top; } +#ifndef QT_MAC_USE_COCOA static bool qt_try_modal(QWidget *widget, EventRef event) { QWidget * top = 0; @@ -1513,6 +1514,7 @@ static bool qt_try_modal(QWidget *widget, EventRef event) #endif return !block_event; } +#endif OSStatus QApplicationPrivate::tabletProximityCallback(EventHandlerCallRef, EventRef carbonEvent, void *) @@ -2890,52 +2892,25 @@ bool QApplicationPrivate::canQuit() #endif } -void onApplicationWindowChangedActivation( QWidget*widget, bool activated ) +void onApplicationWindowChangedActivation(QWidget *widget, bool activated) { #if QT_MAC_USE_COCOA - QApplication *app = qApp; + if (!widget) + return; - if ( activated ) - { - if (QApplicationPrivate::app_style) - { + if (activated) { + if (QApplicationPrivate::app_style) { QEvent ev(QEvent::Style); qt_sendSpontaneousEvent(QApplicationPrivate::app_style, &ev); } - - if (widget && app_do_modal && !qt_try_modal(widget, NULL)) - return; - - if (widget && widget->window()->isVisible()) - { - QWidget *tlw = widget->window(); - - if (tlw->isWindow() && !(tlw->windowType() == Qt::Popup) - && !qt_mac_is_macdrawer(tlw) - && (!tlw->parentWidget() || tlw->isModal() || !(tlw->windowType() == Qt::Tool))) { - bool just_send_event = false; -#if 0 - WindowActivationScope scope; - if ( GetWindowActivationScope((OSWindowRef)wid, &scope) == noErr && - scope == kWindowActivationScopeIndependent) - { - if ( GetFrontWindowOfClass(kAllWindowClasses, true) != wid ) - just_send_event = true; - } -#endif - if (just_send_event) { - QEvent e(QEvent::WindowActivate); - qt_sendSpontaneousEvent(widget, &e); - } else { - app->setActiveWindow(tlw); - } - } - } + qApp->setActiveWindow(widget); } else { // deactivated - if (widget && QApplicationPrivate::active_window == widget) - app->setActiveWindow(0); + if (QApplicationPrivate::active_window == widget) + qApp->setActiveWindow(0); } + QMenuBar::macUpdateMenuBar(); + #else Q_UNUSED(widget); Q_UNUSED(activated); |