From 0a6987bf1aa9624aa11887c593c5330dc4f0ebb8 Mon Sep 17 00:00:00 2001 From: wolfsuit Date: Mon, 23 Sep 2002 07:17:16 +0000 Subject: Minor cleanup, no content changes. --- macosx/tkMacOSXNotify.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index 78b3445..e64fee7 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -12,17 +12,18 @@ * 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.3 2002/09/10 06:46:52 hobbs Exp $ + * RCS: @(#) $Id: tkMacOSXNotify.c,v 1.4 2002/09/23 07:17:16 wolfsuit Exp $ */ #include "tclInt.h" -#include "tclPort.h" /* FIXME - Why do I need these here? */ #undef environ #include "tkMacOSX.h" #include "tkMacOSXEvent.h" + +#include "tclPort.h" #include extern TclStubs tclStubs; @@ -233,7 +234,7 @@ Tk_MacOSXSetupTkNotifier() */ TclFinalizeNotifier(); - + Tcl_SetNotifier(&macNotifierProcs); /* HACK ALERT: There is a bug in Jaguar where when it goes to make @@ -243,9 +244,9 @@ Tk_MacOSXSetupTkNotifier() * the main thread. Calling GetMainEventQueue will force this to * happen. */ - + mainEventQueue = GetMainEventQueue(); - + /* * Tcl_SetNotifier doesn't call the TclInitNotifier * so we call it now. If we don't do this the @@ -705,6 +706,7 @@ DoActualWait(timePtr) Tcl_Time *timePtr; /* Maximum block time, or NULL. */ { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); + OSErr err; if (!tsdPtr->isMainLoop) { Tcl_ConditionWait(&tsdPtr->waitCV, ¬ifierMutex, timePtr); @@ -719,7 +721,7 @@ DoActualWait(timePtr) waitTime = timePtr->sec * kEventDurationSecond + timePtr->usec * kEventDurationMicrosecond; } - ReceiveNextEvent(0, NULL, waitTime, false, &eventRef); + err = ReceiveNextEvent(0, NULL, waitTime, false, &eventRef); Tcl_MutexLock(¬ifierMutex); } } @@ -1097,9 +1099,14 @@ NotifierThreadProc(clientData) } tsdPtr->eventReady = 1; if (tsdPtr->isMainLoop) { + OSErr err; + /* We need to wake up the main loop, and let it have the event. */ EventRef fakeEvent = TkMacOSXCreateFakeEvent(); - PostEventToQueue(GetMainEventQueue(), fakeEvent, kEventPriorityHigh); + EventQueueRef mainEventQueue = GetMainEventQueue(); + + err = PostEventToQueue(mainEventQueue, fakeEvent, + kEventPriorityHigh); ReleaseEvent(fakeEvent); } else { Tcl_ConditionNotify(&tsdPtr->waitCV); @@ -1116,7 +1123,6 @@ NotifierThreadProc(clientData) if (masks[index] & bit) { i = read(receivePipe, buf, 1); - if ((i == 0) || ((i == 1) && (buf[0] == 'q'))) { /* * Someone closed the write end of the pipe or sent us a -- cgit v0.12