summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXNotify.c
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/tkMacOSXNotify.c')
-rw-r--r--macosx/tkMacOSXNotify.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c
index c8c5af9..78b3445 100644
--- a/macosx/tkMacOSXNotify.c
+++ b/macosx/tkMacOSXNotify.c
@@ -12,7 +12,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.2 2002/08/31 06:12:30 das Exp $
+ * RCS: @(#) $Id: tkMacOSXNotify.c,v 1.3 2002/09/10 06:46:52 hobbs Exp $
*/
#include "tclInt.h"
@@ -216,6 +216,7 @@ EventRef TkMacOSXCreateFakeEvent ();
void
Tk_MacOSXSetupTkNotifier()
{
+ EventQueueRef mainEventQueue;
Tcl_NotifierProcs macNotifierProcs = {
TkMacOSXSetTimer,
TkMacOSXWaitForEvent,
@@ -226,9 +227,25 @@ Tk_MacOSXSetupTkNotifier()
TkMacOSXAlertNotifier,
TkMacOSXServiceModeHook
};
-
+
+ /*
+ * Dispose of existing unix notifier thread
+ */
+
+ TclFinalizeNotifier();
+
Tcl_SetNotifier(&macNotifierProcs);
+ /* HACK ALERT: There is a bug in Jaguar where when it goes to make
+ * the event queue for the Main Event Loop, it stores the Current
+ * event loop rather than the Main Event Loop in the Queue structure.
+ * So we have to make sure that the Main Event Queue gets set up on
+ * 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