1 /**************************************************************************** |
1 /**************************************************************************** |
2 ** |
2 ** |
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 ** All rights reserved. |
4 ** All rights reserved. |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
6 ** |
6 ** |
7 ** This file is part of the QtGui module of the Qt Toolkit. |
7 ** This file is part of the QtGui module of the Qt Toolkit. |
8 ** |
8 ** |
490 case NSTabletPoint: |
490 case NSTabletPoint: |
491 case NSTabletProximity: |
491 case NSTabletProximity: |
492 case NSOtherMouseDown: |
492 case NSOtherMouseDown: |
493 case NSOtherMouseUp: |
493 case NSOtherMouseUp: |
494 case NSOtherMouseDragged: |
494 case NSOtherMouseDragged: |
|
495 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 |
|
496 case NSEventTypeGesture: // touch events |
|
497 case NSEventTypeMagnify: |
|
498 case NSEventTypeSwipe: |
|
499 case NSEventTypeRotate: |
|
500 case NSEventTypeBeginGesture: |
|
501 case NSEventTypeEndGesture: |
|
502 #endif |
495 result = true; |
503 result = true; |
496 break; |
504 break; |
497 |
505 |
498 default: |
506 default: |
499 break; |
507 break; |
567 // interrupted. This is mostly an optimization, but it also allow us |
575 // interrupted. This is mostly an optimization, but it also allow us |
568 // to use [NSApp run], which is the recommended way of running applications |
576 // to use [NSApp run], which is the recommended way of running applications |
569 // in cocoa. [NSApp run] should be called at least once for any cocoa app. |
577 // in cocoa. [NSApp run] should be called at least once for any cocoa app. |
570 if (NSModalSession session = d->currentModalSession()) { |
578 if (NSModalSession session = d->currentModalSession()) { |
571 QBoolBlocker execGuard(d->currentExecIsNSAppRun, false); |
579 QBoolBlocker execGuard(d->currentExecIsNSAppRun, false); |
572 while (!d->interrupt && [NSApp runModalSession:session] == NSRunContinuesResponse) |
580 while ([NSApp runModalSession:session] == NSRunContinuesResponse && !d->interrupt) |
573 qt_mac_waitForMoreModalSessionEvents(); |
581 qt_mac_waitForMoreModalSessionEvents(); |
574 if (!d->interrupt && session == d->currentModalSessionCached) { |
582 if (!d->interrupt && session == d->currentModalSessionCached) { |
575 // INVARIANT: Someone called e.g. [NSApp stopModal:] from outside the event |
583 // INVARIANT: Someone called e.g. [NSApp stopModal:] from outside the event |
576 // dispatcher (e.g to stop a native dialog). But that call wrongly stopped |
584 // dispatcher (e.g to stop a native dialog). But that call wrongly stopped |
577 // 'session' as well. As a result, we need to restart all internal sessions: |
585 // 'session' as well. As a result, we need to restart all internal sessions: |