summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXNotify.c
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/tkMacOSXNotify.c')
-rw-r--r--macosx/tkMacOSXNotify.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c
index cf095b8..745ec67 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.12 2005/05/29 07:00:26 das Exp $
+ * RCS: @(#) $Id: tkMacOSXNotify.c,v 1.13 2005/09/10 14:53:21 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--;
}
}