summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXNotify.c
diff options
context:
space:
mode:
authorwolfsuit <wolfsuit>2002-09-23 07:17:16 (GMT)
committerwolfsuit <wolfsuit>2002-09-23 07:17:16 (GMT)
commit0a6987bf1aa9624aa11887c593c5330dc4f0ebb8 (patch)
tree1d7b88285e6f38dbc894aedfbf6da08f08d0d736 /macosx/tkMacOSXNotify.c
parent2c1f6a36c2979271ddf10c49eab31b0a26b349fb (diff)
downloadtk-0a6987bf1aa9624aa11887c593c5330dc4f0ebb8.zip
tk-0a6987bf1aa9624aa11887c593c5330dc4f0ebb8.tar.gz
tk-0a6987bf1aa9624aa11887c593c5330dc4f0ebb8.tar.bz2
Minor cleanup, no content changes.
Diffstat (limited to 'macosx/tkMacOSXNotify.c')
-rw-r--r--macosx/tkMacOSXNotify.c22
1 files 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 <signal.h>
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, &notifierMutex, 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(&notifierMutex);
}
}
@@ -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