summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-02-22 08:49:16 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-02-22 08:49:16 (GMT)
commit75c79f99e4d778313d921991d17e0bae3db4616e (patch)
tree26ad09eb0ff6cef489ff6dc8aafaf9458e33242e /unix
parent353d67037175f0301051248a1db83c99e00df2ef (diff)
parentf584bb01ccf547af727096674302e8a6dbae1252 (diff)
downloadtk-75c79f99e4d778313d921991d17e0bae3db4616e.zip
tk-75c79f99e4d778313d921991d17e0bae3db4616e.tar.gz
tk-75c79f99e4d778313d921991d17e0bae3db4616e.tar.bz2
merge trunk
Diffstat (limited to 'unix')
-rw-r--r--unix/tkAppInit.c7
-rw-r--r--unix/tkUnixEvent.c14
2 files changed, 17 insertions, 4 deletions
diff --git a/unix/tkAppInit.c b/unix/tkAppInit.c
index 3b73ee9..b18179b 100644
--- a/unix/tkAppInit.c
+++ b/unix/tkAppInit.c
@@ -14,7 +14,7 @@
#undef BUILD_tk
#undef STATIC_BUILD
-#include "tkInt.h"
+#include "tk.h"
#ifdef TK_TEST
extern Tcl_PackageInitProc Tktest_Init;
@@ -42,7 +42,7 @@ MODULE_SCOPE int main(int, char **);
*/
#ifdef TK_LOCAL_MAIN_HOOK
-extern int TK_LOCAL_MAIN_HOOK(int *argc, char ***argv);
+MODULE_SCOPE int TK_LOCAL_MAIN_HOOK(int *argc, char ***argv);
#endif
/*
@@ -138,7 +138,8 @@ Tcl_AppInit(
* specific startup file will be run under any conditions.
*/
- (Tcl_SetVar2)(interp, "tcl_rcFileName", NULL, "~/.wishrc", TCL_GLOBAL_ONLY);
+ (Tcl_ObjSetVar2)(interp, Tcl_NewStringObj("tcl_rcFileName", -1), NULL,
+ Tcl_NewStringObj("~/.wishrc", -1), TCL_GLOBAL_ONLY);
return TCL_OK;
}
diff --git a/unix/tkUnixEvent.c b/unix/tkUnixEvent.c
index 4d0ccfa..6268b25 100644
--- a/unix/tkUnixEvent.c
+++ b/unix/tkUnixEvent.c
@@ -116,8 +116,20 @@ TkpOpenDisplay(
const char *displayNameStr)
{
TkDisplay *dispPtr;
- Display *display = XOpenDisplay(displayNameStr);
+ Display *display;
+#ifdef TCL_THREADS
+ static int xinited = 0;
+
+ if (!xinited) {
+ /* Necessary for threaded apps, of no consequence otherwise */
+ /* need only be called once, but must be called before *any* */
+ /* Xlib call is made. */
+ XInitThreads();
+ xinited = 1;
+ }
+#endif
+ display = XOpenDisplay(displayNameStr);
if (display == NULL) {
return NULL;
}