summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authordonal.k.fellows@manchester.ac.uk <dkf>2012-08-27 17:44:47 (GMT)
committerdonal.k.fellows@manchester.ac.uk <dkf>2012-08-27 17:44:47 (GMT)
commit163d70521a442bc63d18819ddaa18b2f5b9f5b9b (patch)
tree6d1c6cec0560b90c359e57d9771574bd24c01b09 /unix
parent76ca319a36c1724741af8c4d0e725b9e278cccbb (diff)
parenta4fb655ab947bca02433ed17b0e3176692d7156b (diff)
downloadtk-163d70521a442bc63d18819ddaa18b2f5b9f5b9b.zip
tk-163d70521a442bc63d18819ddaa18b2f5b9f5b9b.tar.gz
tk-163d70521a442bc63d18819ddaa18b2f5b9f5b9b.tar.bz2
merge trunk
Diffstat (limited to 'unix')
-rw-r--r--unix/tkUnixColor.c21
-rw-r--r--unix/tkUnixWm.c9
2 files changed, 29 insertions, 1 deletions
diff --git a/unix/tkUnixColor.c b/unix/tkUnixColor.c
index 9bfe8bb..43500ad 100644
--- a/unix/tkUnixColor.c
+++ b/unix/tkUnixColor.c
@@ -136,6 +136,25 @@ TkpGetColor(
if (*name != '#') {
XColor screen;
+ if (((*name - 'A') & 0xdf) < sizeof(tkWebColors)/sizeof(tkWebColors[0])) {
+ if (!((name[0] - 'G') & 0xdf) && !((name[1] - 'R') & 0xdf)
+ && !((name[2] - 'A') & 0xdb) && !((name[3] - 'Y') & 0xdf)
+ && !name[4]) {
+ name = "#808080808080";
+ goto gotWebColor;
+ } else {
+ const char *p = tkWebColors[((*name - 'A') & 0x1f)];
+ if (p) {
+ const char *q = name;
+ while (!((*p - *(++q)) & 0xdf)) {
+ if (!*p++) {
+ name = p;
+ goto gotWebColor;
+ }
+ }
+ }
+ }
+ }
if (strlen(name) > 99) {
/* Don't bother to parse this. [Bug 2809525]*/
return (TkColor *) NULL;
@@ -155,6 +174,7 @@ TkpGetColor(
FindClosestColor(tkwin, &screen, &color);
}
} else {
+ gotWebColor:
if (TkParseColor(display, colormap, name, &color) == 0) {
return NULL;
}
@@ -420,6 +440,7 @@ TkpCmapStressed(
return 0;
}
+
/*
* Local Variables:
* mode: c
diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c
index 9df3eae..3362081 100644
--- a/unix/tkUnixWm.c
+++ b/unix/tkUnixWm.c
@@ -6823,7 +6823,14 @@ TkSetTransientFor(Tk_Window tkwin, Tk_Window parent)
if (parent == None) {
parent = Tk_Parent(tkwin);
while (!Tk_IsTopLevel(parent))
- parent = Tk_Parent(tkwin);
+ parent = Tk_Parent(parent);
+ }
+ /*
+ * Prevent crash due to incomplete initialization, or other problems.
+ * [Bugs 3554026, 3561016]
+ */
+ if (((TkWindow *)parent)->wmInfoPtr->wrapperPtr == NULL) {
+ CreateWrapper(((TkWindow *)parent)->wmInfoPtr);
}
XSetTransientForHint(Tk_Display(tkwin),
((TkWindow *)tkwin)->wmInfoPtr->wrapperPtr->window,