jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m
changeset 31170 4d414cfb92cc
parent 27272 cffe6690ee9d
child 31654 9f95289d9553
equal deleted inserted replaced
31169:0647b79041f2 31170:4d414cfb92cc
   514     while (![mediatorObject shouldEndRunLoop] && isRunning) {
   514     while (![mediatorObject shouldEndRunLoop] && isRunning) {
   515         isRunning = [[NSRunLoop currentRunLoop] runMode:(inAWT ? [JNFRunLoop javaRunLoopMode] : NSDefaultRunLoopMode)
   515         isRunning = [[NSRunLoop currentRunLoop] runMode:(inAWT ? [JNFRunLoop javaRunLoopMode] : NSDefaultRunLoopMode)
   516                                              beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.010]];
   516                                              beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.010]];
   517         if (processEvents) {
   517         if (processEvents) {
   518             //We do not spin a runloop here as date is nil, so does not matter which mode to use
   518             //We do not spin a runloop here as date is nil, so does not matter which mode to use
       
   519             // Processing all events excluding NSApplicationDefined which need to be processed 
       
   520             // on the main loop only (those events are intended for disposing resources)
   519             NSEvent *event;
   521             NSEvent *event;
   520             if ((event = [NSApp nextEventMatchingMask:NSAnyEventMask
   522             if ((event = [NSApp nextEventMatchingMask:(NSAnyEventMask & ~NSApplicationDefined)
   521                                            untilDate:nil
   523                                            untilDate:nil
   522                                               inMode:NSDefaultRunLoopMode
   524                                               inMode:NSDefaultRunLoopMode
   523                                              dequeue:YES]) != nil) {
   525                                              dequeue:YES]) != nil) {
   524                 [NSApp sendEvent:event];
   526                 [NSApp sendEvent:event];
   525             }
   527             }