summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-09-08 20:49:55 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-09-08 20:49:55 (GMT)
commit311efb2355355e5bcc6596c702c5cad288cabd5a (patch)
treee78b10da9c7a783f5df6111abbd74e8bd342ea73
parent69810cf540ec4e49dc76d0a1f99f9cab49a7d091 (diff)
parent19d012df44dac9aaf5faa9b3beca5a6396ea21a8 (diff)
downloadtk-311efb2355355e5bcc6596c702c5cad288cabd5a.zip
tk-311efb2355355e5bcc6596c702c5cad288cabd5a.tar.gz
tk-311efb2355355e5bcc6596c702c5cad288cabd5a.tar.bz2
Merge 8.6
-rw-r--r--tests/focus.test2
-rw-r--r--xlib/xgc.c18
2 files changed, 12 insertions, 8 deletions
diff --git a/tests/focus.test b/tests/focus.test
index 7da289d..7c40f1d 100644
--- a/tests/focus.test
+++ b/tests/focus.test
@@ -624,7 +624,7 @@ fixfocus
test focus-6.1 {miscellaneous - embedded application in same process} -constraints {
unix testwrapper
} -setup {
- eval interp delete [interp slaves]
+ eval interp delete [interp children]
} -body {
toplevel .t
wm geometry .t +0+0
diff --git a/xlib/xgc.c b/xlib/xgc.c
index 88feefe..b211286 100644
--- a/xlib/xgc.c
+++ b/xlib/xgc.c
@@ -16,7 +16,6 @@
#if !defined(MAC_OSX_TK)
# include <X11/Xlib.h>
-# define gcCacheSize 0
# define TkpInitGCCache(gc)
# define TkpFreeGCCache(gc)
# define TkpGetGCCache(gc)
@@ -24,10 +23,18 @@
# include <tkMacOSXInt.h>
# include <X11/Xlib.h>
# include <X11/X.h>
-# define gcCacheSize sizeof(TkpGCCache)
#endif
+#define MAX_DASH_LIST_SIZE 10
+typedef struct {
+ XGCValues gc;
+ char dash[MAX_DASH_LIST_SIZE];
+#ifdef MAC_OSX_TK
+ TkpGCCache cache;
+#endif
+} XGCValuesWithCache;
+
/*
*----------------------------------------------------------------------
*
@@ -110,9 +117,7 @@ XCreateGC(
* initialization.
*/
-#define MAX_DASH_LIST_SIZE 10
-
- gp = (GC)ckalloc(sizeof(XGCValues) + MAX_DASH_LIST_SIZE + gcCacheSize);
+ gp = (GC)ckalloc(sizeof(XGCValuesWithCache));
if (!gp) {
return NULL;
}
@@ -175,8 +180,7 @@ XCreateGC(
TkpGCCache*
TkpGetGCCache(GC gc) {
- return (gc ? (TkpGCCache*)(((char*) gc) + sizeof(XGCValues) +
- MAX_DASH_LIST_SIZE) : NULL);
+ return (gc ? &((XGCValuesWithCache *)gc)->cache : NULL);
}
#endif