diff options
Diffstat (limited to 'macosx/tkMacOSXNotify.c')
-rw-r--r-- | macosx/tkMacOSXNotify.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index 0ecccd2..78f159b 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXNotify.c,v 1.5.2.5 2005/05/29 07:00:47 das Exp $ + * RCS: @(#) $Id: tkMacOSXNotify.c,v 1.5.2.6 2005/09/10 14:54:18 das Exp $ */ #include "tclInt.h" @@ -170,11 +170,21 @@ CarbonEventsCheckProc(clientData, flags) ClientData clientData; int flags; { + int numFound; + OSStatus err = noErr; + if (!(flags & TCL_WINDOW_EVENTS)) { return; } - if (GetNumEventsInQueue((EventQueueRef)clientData)) { - TkMacOSXCountAndProcessMacEvents(); + numFound = GetNumEventsInQueue((EventQueueRef)clientData); + + /* Avoid starving other event sources: */ + if (numFound > 4) { + numFound = 4; + } + while (numFound > 0 && err == noErr) { + err = TkMacOSXReceiveAndProcessEvent(); + numFound--; } } |