commit 2a8f2000f1f42bc09d51607e8718e42e6417dccc Author: overweight <5324761+overweight@user.noreply.gitee.com> Date: Mon Sep 30 11:18:32 2019 -0400 Package init diff --git a/Another-proposed-fix-for-4b555aca34-text-search-all-.patch b/Another-proposed-fix-for-4b555aca34-text-search-all-.patch new file mode 100644 index 0000000..4cbd7f6 --- /dev/null +++ b/Another-proposed-fix-for-4b555aca34-text-search-all-.patch @@ -0,0 +1,35 @@ +From f3ebeb35f3773b2e5523da6af25c8021816cfc06 Mon Sep 17 00:00:00 2001 +From: fvogel +Date: Mon, 15 Oct 2018 14:26:50 +0000 +Subject: [PATCH 353/693] Another proposed fix for [4b555aca34]: text search + -all hangs and eats all memory. + +--- + generic/tkText.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/generic/tkText.c b/generic/tkText.c +index d43bef6b0..715e3c045 100644 +--- a/generic/tkText.c ++++ b/generic/tkText.c +@@ -5749,11 +5749,16 @@ SearchCore( + /* + * We only need to set the matchLength once for exact searches, and we + * do it here. It is also used below as the actual pattern length, so +- * it has dual purpose. ++ * it has dual purpose. Warning: to properly advance between matches ++ * the matchLength can't be zero (which would happen when searching ++ * for an empty string). + */ + + pattern = Tcl_GetString(patObj); + matchLength = patObj->length; ++ if (matchLength == 0) { ++ matchLength = 1; ++ } + nl = strchr(pattern, '\n'); + + /* +-- +2.19.1 + diff --git a/Avoid-errors-when-a-menu-is-destroyed-before-its-pos.patch b/Avoid-errors-when-a-menu-is-destroyed-before-its-pos.patch new file mode 100644 index 0000000..5028fd9 --- /dev/null +++ b/Avoid-errors-when-a-menu-is-destroyed-before-its-pos.patch @@ -0,0 +1,33 @@ +From 5d9e46e46991749b766fb89d70c65f7ddb3cae54 Mon Sep 17 00:00:00 2001 +From: culler +Date: Sun, 13 Jan 2019 16:43:19 +0000 +Subject: [PATCH 611/693] Avoid errors when a menu is destroyed before its + postcommand is run. + +--- + library/menu.tcl | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/library/menu.tcl b/library/menu.tcl +index cdfcc13f1..8d06868d1 100644 +--- a/library/menu.tcl ++++ b/library/menu.tcl +@@ -493,11 +493,13 @@ proc ::tk::MenuMotion {menu x y state} { + if {[string is false $mode]} { + set delay [expr {[$menu cget -type] eq "menubar" ? 0 : 50}] + if {[$menu type $index] eq "cascade"} { ++ # Catch these postcascade commands since the menu could be ++ # destroyed before they run. + set Priv(menuActivatedTimer) \ +- [after $delay [list $menu postcascade active]] ++ [after $delay "catch {$menu postcascade active}"] + } else { + set Priv(menuDeactivatedTimer) \ +- [after $delay [list $menu postcascade none]] ++ [after $delay "catch {$menu postcascade none}"] + } + } + } +-- +2.19.1 + diff --git a/Bugfix-4966cad4d4-Now-function-NotebookPlaceSlaves-i.patch b/Bugfix-4966cad4d4-Now-function-NotebookPlaceSlaves-i.patch new file mode 100644 index 0000000..283b4f2 --- /dev/null +++ b/Bugfix-4966cad4d4-Now-function-NotebookPlaceSlaves-i.patch @@ -0,0 +1,31 @@ +From 96a262ae5869d7f9875c6477cb0b23939d84ec12 Mon Sep 17 00:00:00 2001 +From: gcramer +Date: Fri, 21 Jul 2017 14:05:07 +0000 +Subject: [PATCH 030/693] Bugfix [4966cad4d4]: Now function + NotebookPlaceSlaves() in ttkNotebook.c will regard the active index. + +--- + generic/ttk/ttkNotebook.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c +index 83d7db9c5..437ae11a0 100644 +--- a/generic/ttk/ttkNotebook.c ++++ b/generic/ttk/ttkNotebook.c +@@ -595,8 +595,12 @@ static void NotebookPlaceSlaves(void *recordPtr) + Notebook *nb = recordPtr; + int currentIndex = nb->notebook.currentIndex; + if (currentIndex >= 0) { ++ int activeIndex = nb->notebook.activeIndex; ++ int index = (activeIndex >= 0) ? activeIndex : currentIndex; + NotebookDoLayout(nb); +- NotebookPlaceSlave(nb, currentIndex); ++ if (index >= 0) { ++ NotebookPlaceSlave(nb, index); ++ } + } + } + +-- +2.19.1 + diff --git a/Crash-prevention.-Still-buggy-now-test-text-11a.22-f.patch b/Crash-prevention.-Still-buggy-now-test-text-11a.22-f.patch new file mode 100644 index 0000000..57c58d5 --- /dev/null +++ b/Crash-prevention.-Still-buggy-now-test-text-11a.22-f.patch @@ -0,0 +1,33 @@ +From 87dac59f8407ba5d74e52bf223c1b9509aa679ab Mon Sep 17 00:00:00 2001 +From: dgp +Date: Fri, 16 Nov 2018 17:44:47 +0000 +Subject: [PATCH 480/693] Crash prevention. Still buggy, now test text-11a.22 + fails instead of crashing. + +--- + generic/tkText.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/generic/tkText.c b/generic/tkText.c +index 4c536a22d..a0de1d5d2 100644 +--- a/generic/tkText.c ++++ b/generic/tkText.c +@@ -5538,6 +5538,15 @@ RunAfterSyncCmd( + return; + } + ++ if (textPtr->afterSyncCmd == NULL) { ++ /* ++ * [Bug 0a9c9151b5] Probably should have idle handlers coded so that ++ * this cannot happen, but a safety check here at least prevents a ++ * crash. ++ */ ++ return; ++ } ++ + Tcl_Preserve((ClientData) textPtr->interp); + code = Tcl_EvalObjEx(textPtr->interp, textPtr->afterSyncCmd, TCL_EVAL_GLOBAL); + if (code == TCL_ERROR) { +-- +2.19.1 + diff --git a/Fix-1821174fff-and-1938774fff-RenderBadPicture-inval.patch b/Fix-1821174fff-and-1938774fff-RenderBadPicture-inval.patch new file mode 100644 index 0000000..1f6b175 --- /dev/null +++ b/Fix-1821174fff-and-1938774fff-RenderBadPicture-inval.patch @@ -0,0 +1,35 @@ +From 6b354b74b09729ef0b336a4c1504ed66824a4d5a Mon Sep 17 00:00:00 2001 +From: fvogel +Date: Sun, 14 Jan 2018 14:54:17 +0000 +Subject: [PATCH 108/693] Fix [1821174fff] and [1938774fff]: RenderBadPicture + (invalid Picture parameter) error returned on application exit when 'send' + was renamed to {}. Patch from Christian Werner. + +--- + unix/tkUnixRFont.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c +index d43ed2460..abdde7819 100644 +--- a/unix/tkUnixRFont.c ++++ b/unix/tkUnixRFont.c +@@ -388,6 +388,16 @@ FinishedWithFont( + if (fontPtr->fontset) { + FcFontSetDestroy(fontPtr->fontset); + } ++ ++ /* ++ * Synchronize with X server before dropping the error handler. ++ * This seems to catch sporadic RenderBadPicture errors on tear ++ * down of an application. ++ * ++ * See bugs [1821174fff] and [1938774fff]. ++ */ ++ XSync(fontPtr->display, False); ++ + Tk_DeleteErrorHandler(handler); + } + +-- +2.19.1 + diff --git a/Fix-3441086fff-ttk-style-layout-with-empty-children-.patch b/Fix-3441086fff-ttk-style-layout-with-empty-children-.patch new file mode 100644 index 0000000..7a37b89 --- /dev/null +++ b/Fix-3441086fff-ttk-style-layout-with-empty-children-.patch @@ -0,0 +1,26 @@ +From f48a2f15358bfe0797996ed11b49a6c2096b6371 Mon Sep 17 00:00:00 2001 +From: fvogel +Date: Fri, 24 Aug 2018 21:43:21 +0000 +Subject: [PATCH 294/693] Fix [3441086fff]: ttk::style layout with empty + -children silently disappears + +--- + generic/ttk/ttkLayout.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/generic/ttk/ttkLayout.c b/generic/ttk/ttkLayout.c +index ba2458989..924355aa6 100644 +--- a/generic/ttk/ttkLayout.c ++++ b/generic/ttk/ttkLayout.c +@@ -702,6 +702,8 @@ Ttk_LayoutTemplate Ttk_ParseLayoutTemplate(Tcl_Interp *interp, Tcl_Obj *objPtr) + if (childSpec) { + tail->child = Ttk_ParseLayoutTemplate(interp, childSpec); + if (!tail->child) { ++ Tcl_SetObjResult(interp, Tcl_ObjPrintf("Empty -children value")); ++ Tcl_SetErrorCode(interp, "TTK", "VALUE", "LAYOUT", NULL); + goto error; + } + } +-- +2.19.1 + diff --git a/Fix-382712ade6-X11-event-generate-.-KeyPress-segfaul.patch b/Fix-382712ade6-X11-event-generate-.-KeyPress-segfaul.patch new file mode 100644 index 0000000..f9680ea --- /dev/null +++ b/Fix-382712ade6-X11-event-generate-.-KeyPress-segfaul.patch @@ -0,0 +1,59 @@ +From 61066408712d7d0a8cbde84712b49fef449bb181 Mon Sep 17 00:00:00 2001 +From: fvogel +Date: Wed, 10 Jan 2018 20:45:24 +0000 +Subject: [PATCH 105/693] Fix [382712ade6]: X11: 'event generate . ' + segfaults. Patch from Christian Werner. + +--- + unix/tkUnixKey.c | 28 +++++++++++++++++++++++++++- + 1 file changed, 27 insertions(+), 1 deletion(-) + +diff --git a/unix/tkUnixKey.c b/unix/tkUnixKey.c +index 23c4aa48d..dcdc85f05 100644 +--- a/unix/tkUnixKey.c ++++ b/unix/tkUnixKey.c +@@ -110,7 +110,7 @@ TkpGetString( + XEvent *eventPtr, /* X keyboard event. */ + Tcl_DString *dsPtr) /* Initialized, empty string to hold result. */ + { +- int len; ++ int len, mincode, maxcode; + Tcl_DString buf; + TkKeyEvent *kePtr = (TkKeyEvent *) eventPtr; + +@@ -125,6 +125,32 @@ TkpGetString( + return Tcl_DStringValue(dsPtr); + } + ++ /* ++ * Only do this for KeyPress events, otherwise ++ * further Xlib function behavior might be undefined. ++ */ ++ ++ if (eventPtr->type != KeyPress) { ++ len = 0; ++ Tcl_DStringSetLength(dsPtr, len); ++ goto done; ++ } ++ ++ /* ++ * Filter keycodes out of range, otherwise ++ * further Xlib function behavior might be undefined. ++ */ ++ ++ mincode = 0; ++ maxcode = -1; ++ XDisplayKeycodes(winPtr->dispPtr->display, &mincode, &maxcode); ++ if ((eventPtr->xkey.keycode < mincode) || ++ (eventPtr->xkey.keycode > maxcode)) { ++ len = 0; ++ Tcl_DStringSetLength(dsPtr, len); ++ goto done; ++ } ++ + #ifdef TK_USE_INPUT_METHODS + if ((winPtr->dispPtr->flags & TK_DISPLAY_USE_IM) + && (winPtr->inputContext != NULL) +-- +2.19.1 + diff --git a/Fix-4b555aca34-text-search-all-hangs-and-eats-all-me.patch b/Fix-4b555aca34-text-search-all-hangs-and-eats-all-me.patch new file mode 100644 index 0000000..d9f4095 --- /dev/null +++ b/Fix-4b555aca34-text-search-all-hangs-and-eats-all-me.patch @@ -0,0 +1,28 @@ +From 45f12e010e97704ab8f7b6fb932ebe14c5596779 Mon Sep 17 00:00:00 2001 +From: fvogel +Date: Thu, 11 Oct 2018 20:00:40 +0000 +Subject: [PATCH 349/693] Fix [4b555aca34]: text search -all hangs and eats all + memory + +--- + generic/tkText.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/generic/tkText.c b/generic/tkText.c +index d43bef6b0..6c5262426 100644 +--- a/generic/tkText.c ++++ b/generic/tkText.c +@@ -6070,8 +6070,8 @@ SearchCore( + matchOffset = p - startOfLine; + + if (searchSpecPtr->all && +- !searchSpecPtr->foundMatchProc(lineNum, searchSpecPtr, +- lineInfo, theLine, matchOffset, matchLength)) { ++ (!searchSpecPtr->foundMatchProc(lineNum, searchSpecPtr, ++ lineInfo, theLine, matchOffset, matchLength) || (matchLength == 0)) ) { + /* + * We reached the end of the search. + */ +-- +2.19.1 + diff --git a/Fix-502e74e9ad-crash-for-untrusted-X-connections-for.patch b/Fix-502e74e9ad-crash-for-untrusted-X-connections-for.patch new file mode 100644 index 0000000..0c2a766 --- /dev/null +++ b/Fix-502e74e9ad-crash-for-untrusted-X-connections-for.patch @@ -0,0 +1,140 @@ +From f0ac004c7b9eb1d05be53e4b764e81076d314c6f Mon Sep 17 00:00:00 2001 +From: fvogel +Date: Mon, 29 Jan 2018 21:32:53 +0000 +Subject: [PATCH 131/693] Fix [502e74e9ad]: crash for untrusted X connections + (for ssh: ForwardX11Trusted no). Patch from Christian Werner. + +--- + unix/tkUnixSend.c | 66 ++++++++++++++++++++++++++++++----------------- + 1 file changed, 42 insertions(+), 24 deletions(-) + +diff --git a/unix/tkUnixSend.c b/unix/tkUnixSend.c +index bbbdd774c..95e5ae27e 100644 +--- a/unix/tkUnixSend.c ++++ b/unix/tkUnixSend.c +@@ -261,11 +261,14 @@ RegOpen( + unsigned long bytesAfter; + Atom actualType; + char **propertyPtr; ++ Tk_ErrorHandler handler; + + if (dispPtr->commTkwin == NULL) { + SendInit(interp, dispPtr); + } + ++ handler = Tk_CreateErrorHandler(dispPtr->display, -1, -1, -1, NULL, NULL); ++ + regPtr = ckalloc(sizeof(NameRegistry)); + regPtr->dispPtr = dispPtr; + regPtr->locked = 0; +@@ -306,8 +309,11 @@ RegOpen( + XDeleteProperty(dispPtr->display, + RootWindow(dispPtr->display, 0), + dispPtr->registryProperty); ++ XSync(dispPtr->display, False); + } + ++ Tk_DeleteErrorHandler(handler); ++ + /* + * Xlib placed an extra null byte after the end of the property, just to + * make sure that it is always NULL-terminated. Be sure to include this +@@ -514,6 +520,11 @@ RegClose( + NameRegistry *regPtr) /* Pointer to a registry opened with a + * previous call to RegOpen. */ + { ++ Tk_ErrorHandler handler; ++ ++ handler = Tk_CreateErrorHandler(regPtr->dispPtr->display, -1, -1, -1, ++ NULL, NULL); ++ + if (regPtr->modified) { + if (!regPtr->locked && !localData.sendDebug) { + Tcl_Panic("The name registry was modified without being locked!"); +@@ -540,6 +551,8 @@ RegClose( + + XFlush(regPtr->dispPtr->display); + ++ Tk_DeleteErrorHandler(handler); ++ + if (regPtr->property != NULL) { + if (regPtr->allocedByX) { + XFree(regPtr->property); +@@ -1095,6 +1108,31 @@ Tk_SendObjCmd( + Tcl_DStringAppend(&request, " ", 1); + Tcl_DStringAppend(&request, Tcl_GetString(objv[i]), -1); + } ++ ++ if (!async) { ++ /* ++ * Register the fact that we're waiting for a command to complete ++ * (this is needed by SendEventProc and by AppendErrorProc to pass ++ * back the command's results). Set up a timeout handler so that ++ * we can check during long sends to make sure that the destination ++ * application is still alive. ++ * ++ * We prepare the pending struct here in order to catch potential ++ * early X errors from AppendPropCarefully() due to XSync(). ++ */ ++ ++ pending.serial = localData.sendSerial; ++ pending.dispPtr = dispPtr; ++ pending.target = destName; ++ pending.commWindow = commWindow; ++ pending.interp = interp; ++ pending.result = NULL; ++ pending.errorInfo = NULL; ++ pending.errorCode = NULL; ++ pending.gotResponse = 0; ++ pending.nextPtr = tsdPtr->pendingCommands; ++ tsdPtr->pendingCommands = &pending; ++ } + (void) AppendPropCarefully(dispPtr->display, commWindow, + dispPtr->commProperty, Tcl_DStringValue(&request), + Tcl_DStringLength(&request) + 1, (async ? NULL : &pending)); +@@ -1108,26 +1146,6 @@ Tk_SendObjCmd( + return TCL_OK; + } + +- /* +- * Register the fact that we're waiting for a command to complete (this is +- * needed by SendEventProc and by AppendErrorProc to pass back the +- * command's results). Set up a timeout handler so that we can check +- * during long sends to make sure that the destination application is +- * still alive. +- */ +- +- pending.serial = localData.sendSerial; +- pending.dispPtr = dispPtr; +- pending.target = destName; +- pending.commWindow = commWindow; +- pending.interp = interp; +- pending.result = NULL; +- pending.errorInfo = NULL; +- pending.errorCode = NULL; +- pending.gotResponse = 0; +- pending.nextPtr = tsdPtr->pendingCommands; +- tsdPtr->pendingCommands = &pending; +- + /* + * Enter a loop processing X events until the result comes in or the + * target is declared to be dead. While waiting for a result, look only at +@@ -1959,11 +1977,11 @@ TkpTestsendCmd( + return TCL_ERROR; + } + +- if (Tcl_GetIndexFromObjStruct(interp, objv[1], testsendOptions, ++ if (Tcl_GetIndexFromObjStruct(interp, objv[1], testsendOptions, + sizeof(char *), "option", 0, &index) != TCL_OK) { +- return TCL_ERROR; +- } +- if (index == TESTSEND_BOGUS) { ++ return TCL_ERROR; ++ } ++ if (index == TESTSEND_BOGUS) { + XChangeProperty(winPtr->dispPtr->display, + RootWindow(winPtr->dispPtr->display, 0), + winPtr->dispPtr->registryProperty, XA_INTEGER, 32, +-- +2.19.1 + diff --git a/Fix-5d991b822e-segmentation-violation-in-TclObjLooku.patch b/Fix-5d991b822e-segmentation-violation-in-TclObjLooku.patch new file mode 100644 index 0000000..f0dd29b --- /dev/null +++ b/Fix-5d991b822e-segmentation-violation-in-TclObjLooku.patch @@ -0,0 +1,272 @@ +From 27d00ef04f9ecbafef219105aa9dec4b54787b33 Mon Sep 17 00:00:00 2001 +From: fvogel +Date: Sun, 28 Jan 2018 19:49:55 +0000 +Subject: [PATCH 127/693] Fix [5d991b822e]: segmentation violation in + TclObjLookupVarEx. Patch from Christian Werner. + +--- + generic/tkButton.c | 30 ++++++++++++++++++++++++++++-- + generic/tkEntry.c | 17 +++++++++++++++-- + generic/tkListbox.c | 17 +++++++++++++++-- + generic/tkMenu.c | 11 +++++++++++ + generic/tkMenubutton.c | 13 +++++++++++++ + generic/tkMessage.c | 13 +++++++++++++ + generic/tkScale.c | 13 +++++++++++++ + generic/ttk/ttkTrace.c | 15 +++++++++++++-- + 8 files changed, 121 insertions(+), 8 deletions(-) + +diff --git a/generic/tkButton.c b/generic/tkButton.c +index b7e314e74..e114a5108 100644 +--- a/generic/tkButton.c ++++ b/generic/tkButton.c +@@ -1610,6 +1610,19 @@ ButtonVarProc( + const char *value; + Tcl_Obj *valuePtr; + ++ /* ++ * See ticket [5d991b82]. ++ */ ++ ++ if (butPtr->selVarNamePtr == NULL) { ++ if (!(flags & TCL_INTERP_DESTROYED)) { ++ Tcl_UntraceVar2(interp, name1, name2, ++ TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, ++ ButtonVarProc, clientData); ++ } ++ return NULL; ++ } ++ + /* + * If the variable is being unset, then just re-establish the trace unless + * the whole interpreter is going away. +@@ -1692,8 +1705,8 @@ static char * + ButtonTextVarProc( + ClientData clientData, /* Information about button. */ + Tcl_Interp *interp, /* Interpreter containing variable. */ +- const char *name1, /* Not used. */ +- const char *name2, /* Not used. */ ++ const char *name1, /* Name of variable. */ ++ const char *name2, /* Second part of variable name. */ + int flags) /* Information about what happened. */ + { + TkButton *butPtr = clientData; +@@ -1703,6 +1716,19 @@ ButtonTextVarProc( + return NULL; + } + ++ /* ++ * See ticket [5d991b82]. ++ */ ++ ++ if (butPtr->textVarNamePtr == NULL) { ++ if (!(flags & TCL_INTERP_DESTROYED)) { ++ Tcl_UntraceVar2(interp, name1, name2, ++ TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, ++ ButtonTextVarProc, clientData); ++ } ++ return NULL; ++ } ++ + /* + * If the variable is unset, then immediately recreate it unless the whole + * interpreter is going away. +diff --git a/generic/tkEntry.c b/generic/tkEntry.c +index 25774cc2f..678691fca 100644 +--- a/generic/tkEntry.c ++++ b/generic/tkEntry.c +@@ -3135,8 +3135,8 @@ static char * + EntryTextVarProc( + ClientData clientData, /* Information about button. */ + Tcl_Interp *interp, /* Interpreter containing variable. */ +- const char *name1, /* Not used. */ +- const char *name2, /* Not used. */ ++ const char *name1, /* Name of variable. */ ++ const char *name2, /* Second part of variable name. */ + int flags) /* Information about what happened. */ + { + Entry *entryPtr = clientData; +@@ -3149,6 +3149,19 @@ EntryTextVarProc( + return NULL; + } + ++ /* ++ * See ticket [5d991b82]. ++ */ ++ ++ if (entryPtr->textVarName == NULL) { ++ if (!(flags & TCL_INTERP_DESTROYED)) { ++ Tcl_UntraceVar2(interp, name1, name2, ++ TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, ++ EntryTextVarProc, clientData); ++ } ++ return NULL; ++ } ++ + /* + * If the variable is unset, then immediately recreate it unless the whole + * interpreter is going away. +diff --git a/generic/tkListbox.c b/generic/tkListbox.c +index b18a7f49f..5f650fed3 100644 +--- a/generic/tkListbox.c ++++ b/generic/tkListbox.c +@@ -3431,8 +3431,8 @@ static char * + ListboxListVarProc( + ClientData clientData, /* Information about button. */ + Tcl_Interp *interp, /* Interpreter containing variable. */ +- const char *name1, /* Not used. */ +- const char *name2, /* Not used. */ ++ const char *name1, /* Name of variable. */ ++ const char *name2, /* Second part of variable name. */ + int flags) /* Information about what happened. */ + { + Listbox *listPtr = clientData; +@@ -3440,6 +3440,19 @@ ListboxListVarProc( + int oldLength, i; + Tcl_HashEntry *entry; + ++ /* ++ * See ticket [5d991b82]. ++ */ ++ ++ if (listPtr->listVarName == NULL) { ++ if (!(flags & TCL_INTERP_DESTROYED)) { ++ Tcl_UntraceVar2(interp, name1, name2, ++ TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, ++ ListboxListVarProc, clientData); ++ } ++ return NULL; ++ } ++ + /* + * Bwah hahahaha! Puny mortal, you can't unset a -listvar'd variable! + */ +diff --git a/generic/tkMenu.c b/generic/tkMenu.c +index 42ddbd5ec..5859ac050 100644 +--- a/generic/tkMenu.c ++++ b/generic/tkMenu.c +@@ -2500,6 +2500,17 @@ MenuVarProc( + return NULL; + } + ++ /* ++ * See ticket [5d991b82]. ++ */ ++ ++ if (mePtr->namePtr == NULL) { ++ Tcl_UntraceVar2(interp, name1, name2, ++ TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, ++ MenuVarProc, clientData); ++ return NULL; ++ } ++ + name = Tcl_GetString(mePtr->namePtr); + + /* +diff --git a/generic/tkMenubutton.c b/generic/tkMenubutton.c +index 1a4d5ae6e..2c1676c60 100644 +--- a/generic/tkMenubutton.c ++++ b/generic/tkMenubutton.c +@@ -881,6 +881,19 @@ MenuButtonTextVarProc( + const char *value; + unsigned len; + ++ /* ++ * See ticket [5d991b82]. ++ */ ++ ++ if (mbPtr->textVarName == NULL) { ++ if (!(flags & TCL_INTERP_DESTROYED)) { ++ Tcl_UntraceVar2(interp, name1, name2, ++ TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, ++ MenuButtonTextVarProc, clientData); ++ } ++ return NULL; ++ } ++ + /* + * If the variable is unset, then immediately recreate it unless the whole + * interpreter is going away. +diff --git a/generic/tkMessage.c b/generic/tkMessage.c +index 2b7199875..f65b04687 100644 +--- a/generic/tkMessage.c ++++ b/generic/tkMessage.c +@@ -838,6 +838,19 @@ MessageTextVarProc( + register Message *msgPtr = clientData; + const char *value; + ++ /* ++ * See ticket [5d991b82]. ++ */ ++ ++ if (msgPtr->textVarName == NULL) { ++ if (!(flags & TCL_INTERP_DESTROYED)) { ++ Tcl_UntraceVar2(interp, name1, name2, ++ TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, ++ MessageTextVarProc, clientData); ++ } ++ return NULL; ++ } ++ + /* + * If the variable is unset, then immediately recreate it unless the whole + * interpreter is going away. +diff --git a/generic/tkScale.c b/generic/tkScale.c +index ef67630d8..af45afa73 100644 +--- a/generic/tkScale.c ++++ b/generic/tkScale.c +@@ -1192,6 +1192,19 @@ ScaleVarProc( + Tcl_Obj *valuePtr; + int result; + ++ /* ++ * See ticket [5d991b82]. ++ */ ++ ++ if (scalePtr->varNamePtr == NULL) { ++ if (!(flags & TCL_INTERP_DESTROYED)) { ++ Tcl_UntraceVar2(interp, name1, name2, ++ TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, ++ ScaleVarProc, clientData); ++ } ++ return NULL; ++ } ++ + /* + * If the variable is unset, then immediately recreate it unless the whole + * interpreter is going away. +diff --git a/generic/ttk/ttkTrace.c b/generic/ttk/ttkTrace.c +index ba66db427..e6eead2bc 100644 +--- a/generic/ttk/ttkTrace.c ++++ b/generic/ttk/ttkTrace.c +@@ -26,8 +26,8 @@ static char * + VarTraceProc( + ClientData clientData, /* Widget record pointer */ + Tcl_Interp *interp, /* Interpreter containing variable. */ +- const char *name1, /* (unused) */ +- const char *name2, /* (unused) */ ++ const char *name1, /* Name of variable. */ ++ const char *name2, /* Second part of variable name. */ + int flags) /* Information about what happened. */ + { + Ttk_TraceHandle *tracePtr = clientData; +@@ -38,6 +38,17 @@ VarTraceProc( + return NULL; + } + ++ /* ++ * See ticket [5d991b82]. ++ */ ++ ++ if (tracePtr->varnameObj == NULL) { ++ Tcl_UntraceVar2(interp, name1, name2, ++ TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, ++ VarTraceProc, clientData); ++ return NULL; ++ } ++ + name = Tcl_GetString(tracePtr->varnameObj); + + /* +-- +2.19.1 + diff --git a/Fix-6437e8d00d-font-24.5-test-fails-on-macOS-and-Lin.patch b/Fix-6437e8d00d-font-24.5-test-fails-on-macOS-and-Lin.patch new file mode 100644 index 0000000..1e50cd4 --- /dev/null +++ b/Fix-6437e8d00d-font-24.5-test-fails-on-macOS-and-Lin.patch @@ -0,0 +1,40 @@ +From 19cb045850ffebc2785f44a362fdc7e199f293a5 Mon Sep 17 00:00:00 2001 +From: fvogel +Date: Sun, 30 Sep 2018 14:45:49 +0000 +Subject: [PATCH 334/693] Fix [6437e8d00d]: font-24.5 test fails on macOS and + Linux. This is the fix for Linux, with Xft enabled (the default). + +--- + unix/tkUnixRFont.c | 16 +++++++++++++--- + 1 file changed, 13 insertions(+), 3 deletions(-) + +diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c +index 8e0ce5552..70aebfa72 100644 +--- a/unix/tkUnixRFont.c ++++ b/unix/tkUnixRFont.c +@@ -711,9 +711,19 @@ Tk_MeasureChars( + (flags & TK_AT_LEAST_ONE && curByte == 0)) { + curX = newX; + curByte = newByte; +- } else if (flags & TK_WHOLE_WORDS && termX != 0) { +- curX = termX; +- curByte = termByte; ++ } else if (flags & TK_WHOLE_WORDS) { ++ if ((flags & TK_AT_LEAST_ONE) && (termX == 0)) { ++ /* ++ * No space was seen before reaching the right ++ * of the allotted maxLength space, i.e. no word ++ * boundary. Return the string that fills the ++ * allotted space, without overfill. ++ * curX and curByte are already the right ones: ++ */ ++ } else { ++ curX = termX; ++ curByte = termByte; ++ } + } + break; + } +-- +2.19.1 + diff --git a/Fix-657c389120-and-b4214b4712-Segfault-when-destroyi.patch b/Fix-657c389120-and-b4214b4712-Segfault-when-destroyi.patch new file mode 100644 index 0000000..14a0aa3 --- /dev/null +++ b/Fix-657c389120-and-b4214b4712-Segfault-when-destroyi.patch @@ -0,0 +1,29 @@ +From f884f275a1ae02b0a08fc22fd3c075d64394a352 Mon Sep 17 00:00:00 2001 +From: fvogel +Date: Sat, 13 Jan 2018 13:50:46 +0000 +Subject: [PATCH 107/693] Fix [657c389120] and [b4214b4712]: Segfault when + destroying menu with checkbutton entry + +--- + generic/tkMenu.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/generic/tkMenu.c b/generic/tkMenu.c +index d24516f6a..42ddbd5ec 100644 +--- a/generic/tkMenu.c ++++ b/generic/tkMenu.c +@@ -2495,6 +2495,11 @@ MenuVarProc( + } + + menuPtr = mePtr->menuPtr; ++ ++ if (menuPtr->menuFlags & MENU_DELETION_PENDING) { ++ return NULL; ++ } ++ + name = Tcl_GetString(mePtr->namePtr); + + /* +-- +2.19.1 + diff --git a/Fix-6b22d436aa-Treeview-ActivateHeading-Binding-Fail.patch b/Fix-6b22d436aa-Treeview-ActivateHeading-Binding-Fail.patch new file mode 100644 index 0000000..8abb522 --- /dev/null +++ b/Fix-6b22d436aa-Treeview-ActivateHeading-Binding-Fail.patch @@ -0,0 +1,27 @@ +From cf0ab9321dd689a22c6d59f52b14d479605553e9 Mon Sep 17 00:00:00 2001 +From: fvogel +Date: Thu, 1 Nov 2018 21:29:32 +0000 +Subject: [PATCH 436/693] Fix [6b22d436aa]: Treeview ActivateHeading Binding + Fails After Widget Deletion. Thanks to Brian O'Hagan for the report and the + patch. + +--- + library/ttk/treeview.tcl | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/library/ttk/treeview.tcl b/library/ttk/treeview.tcl +index 87725875e..1ed87dbcd 100644 +--- a/library/ttk/treeview.tcl ++++ b/library/ttk/treeview.tcl +@@ -120,7 +120,7 @@ proc ttk::treeview::ActivateHeading {w heading} { + variable State + + if {$w != $State(activeWidget) || $heading != $State(activeHeading)} { +- if {$State(activeHeading) != {}} { ++ if {[winfo exists $State(activeWidget)] && $State(activeHeading) != {}} { + $State(activeWidget) heading $State(activeHeading) state !active + } + if {$heading != {}} { +-- +2.19.1 + diff --git a/Fix-broken-build-one-line-of-the-patch-was-missing.patch b/Fix-broken-build-one-line-of-the-patch-was-missing.patch new file mode 100644 index 0000000..aed17bc --- /dev/null +++ b/Fix-broken-build-one-line-of-the-patch-was-missing.patch @@ -0,0 +1,24 @@ +From 5e2dd69aeb80d6277eda5669e2b69d4caee43af2 Mon Sep 17 00:00:00 2001 +From: fvogel +Date: Thu, 18 Jan 2018 14:23:04 +0000 +Subject: [PATCH 120/693] Fix broken build (one line of the patch was missing) + +--- + unix/tkUnixKey.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/unix/tkUnixKey.c b/unix/tkUnixKey.c +index dcdc85f05..d8aa5abe6 100644 +--- a/unix/tkUnixKey.c ++++ b/unix/tkUnixKey.c +@@ -243,6 +243,7 @@ TkpGetString( + * from having to reenter the XIM engine. [Bug 1373712] + */ + ++done: + kePtr->charValuePtr = ckalloc(len + 1); + kePtr->charValueLen = len; + memcpy(kePtr->charValuePtr, Tcl_DStringValue(dsPtr), (unsigned) len + 1); +-- +2.19.1 + diff --git a/Fix-de01e24aa1-Text-replace-command-involving-select.patch b/Fix-de01e24aa1-Text-replace-command-involving-select.patch new file mode 100644 index 0000000..7c5bdb9 --- /dev/null +++ b/Fix-de01e24aa1-Text-replace-command-involving-select.patch @@ -0,0 +1,50 @@ +From 4eec31fbb436bb39ad1be0ac1d4f6b5804bca4e1 Mon Sep 17 00:00:00 2001 +From: fvogel +Date: Wed, 13 Jun 2018 20:27:21 +0000 +Subject: [PATCH 232/693] Fix [de01e24aa1]: Text replace command involving + selection crashes + +--- + generic/tkText.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/generic/tkText.c b/generic/tkText.c +index 308855f13..78260e08c 100644 +--- a/generic/tkText.c ++++ b/generic/tkText.c +@@ -1465,7 +1465,7 @@ TextWidgetObjCmd( + * unnecessarily. + */ + +- int deleteInsertOffset, insertLength, j; ++ int deleteInsertOffset, insertLength, j, indexFromLine, indexFromByteOffset; + + insertLength = 0; + for (j = 4; j < objc; j += 2) { +@@ -1483,6 +1483,9 @@ TextWidgetObjCmd( + deleteInsertOffset = insertLength; + } + ++ indexFromLine = TkBTreeLinesTo(textPtr, indexFromPtr->linePtr); ++ indexFromByteOffset = indexFromPtr->byteIndex; ++ + result = TextReplaceCmd(textPtr, interp, indexFromPtr, + indexToPtr, objc, objv, 0); + +@@ -1491,8 +1494,11 @@ TextWidgetObjCmd( + * Move the insertion position to the correct place. + */ + +- indexFromPtr = TkTextGetIndexFromObj(interp, textPtr, objv[2]); +- TkTextIndexForwChars(NULL, indexFromPtr, ++ TkTextIndex indexTmp; ++ ++ TkTextMakeByteIndex(textPtr->sharedTextPtr->tree, textPtr, indexFromLine, ++ indexFromByteOffset, &indexTmp); ++ TkTextIndexForwChars(NULL, &indexTmp, + deleteInsertOffset, &index, COUNT_INDICES); + TkBTreeUnlinkSegment(textPtr->insertMarkPtr, + textPtr->insertMarkPtr->body.mark.linePtr); +-- +2.19.1 + diff --git a/Fix-fbaed1f66b-image-create-photo-errors-out-on-a-sa.patch b/Fix-fbaed1f66b-image-create-photo-errors-out-on-a-sa.patch new file mode 100644 index 0000000..db4b5d7 --- /dev/null +++ b/Fix-fbaed1f66b-image-create-photo-errors-out-on-a-sa.patch @@ -0,0 +1,97 @@ +From 794d69dcfe3c832df39496ecc9a9beb137e0a732 Mon Sep 17 00:00:00 2001 +From: fvogel +Date: Sat, 21 Jul 2018 13:37:42 +0000 +Subject: [PATCH 256/693] Fix [fbaed1f66b]: [image create photo] errors out on + a sane animated gif + +--- + generic/tkImgGIF.c | 46 +++++++++++++++++++++------------------------- + 1 file changed, 21 insertions(+), 25 deletions(-) + +diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c +index be90f0684..7c4872bef 100644 +--- a/generic/tkImgGIF.c ++++ b/generic/tkImgGIF.c +@@ -1141,9 +1141,9 @@ ReadImage( + * Last pass reset the decoder, so the first code we see + * must be a singleton. Seed the stack with it, and set up + * the old/first code pointers for insertion into the +- * string table. We can't just roll this into the +- * clearCode test above, because at that point we have not +- * yet read the next code. ++ * codes table. We can't just roll this into the clearCode ++ * test above, because at that point we have not yet read ++ * the next code. + */ + + *top++ = append[code]; +@@ -1154,11 +1154,11 @@ ReadImage( + + inCode = code; + +- if (code == maxCode) { ++ if ((code == maxCode) && (maxCode < (1 << MAX_LWZ_BITS))) { + /* + * maxCode is always one bigger than our highest assigned + * code. If the code we see is equal to maxCode, then we +- * are about to add a new string to the table. ??? ++ * are about to add a new entry to the codes table. + */ + + *top++ = firstCode; +@@ -1167,7 +1167,7 @@ ReadImage( + + while (code > clearCode) { + /* +- * Populate the stack by tracing the string in the string ++ * Populate the stack by tracing the code in the codes + * table from its tail to its head + */ + +@@ -1176,28 +1176,24 @@ ReadImage( + } + firstCode = append[code]; + +- /* +- * If there's no more room in our string table, quit. +- * Otherwise, add a new string to the table +- */ +- +- if (maxCode >= (1 << MAX_LWZ_BITS)) { +- return TCL_OK; +- } +- +- /* +- * Push the head of the string onto the stack. +- */ ++ /* ++ * Push the head of the code onto the stack. ++ */ + +- *top++ = firstCode; ++ *top++ = firstCode; + +- /* +- * Add a new string to the string table +- */ ++ if (maxCode < (1 << MAX_LWZ_BITS)) { ++ /* ++ * If there's still room in our codes table, add a new entry. ++ * Otherwise don't, and keep using the current table. ++ * See DEFERRED CLEAR CODE IN LZW COMPRESSION in the GIF89a ++ * specification. ++ */ + +- prefix[maxCode] = oldCode; +- append[maxCode] = firstCode; +- maxCode++; ++ prefix[maxCode] = oldCode; ++ append[maxCode] = firstCode; ++ maxCode++; ++ } + + /* + * maxCode tells us the maximum code value we can accept. If +-- +2.19.1 + diff --git a/Further-patch-from-Christian-Werner-on-the-observati.patch b/Further-patch-from-Christian-Werner-on-the-observati.patch new file mode 100644 index 0000000..18eb617 --- /dev/null +++ b/Further-patch-from-Christian-Werner-on-the-observati.patch @@ -0,0 +1,38 @@ +From 537e7f8ae810343e6d6685e97492c5881298bd7d Mon Sep 17 00:00:00 2001 +From: fvogel +Date: Thu, 3 May 2018 06:12:45 +0000 +Subject: [PATCH 222/693] Further patch from Christian Werner, on the + observation that on Fedora 28 Workstation on x86_64 XKeyEvents generated by + input methods have the keycode field set to 0 which fails the range check and + thus doesn't get processed further + +--- + unix/tkUnixKey.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/unix/tkUnixKey.c b/unix/tkUnixKey.c +index d8aa5abe6..c5a024fe6 100644 +--- a/unix/tkUnixKey.c ++++ b/unix/tkUnixKey.c +@@ -146,9 +146,15 @@ TkpGetString( + XDisplayKeycodes(winPtr->dispPtr->display, &mincode, &maxcode); + if ((eventPtr->xkey.keycode < mincode) || + (eventPtr->xkey.keycode > maxcode)) { +- len = 0; +- Tcl_DStringSetLength(dsPtr, len); +- goto done; ++ if (eventPtr->xkey.keycode != 0) { ++ len = 0; ++ Tcl_DStringSetLength(dsPtr, len); ++ goto done; ++ } ++ /* ++ * Keycode 0 seems to come from e.g. ibus input methods, ++ * we let this pass and hope for the best. ++ */ + } + + #ifdef TK_USE_INPUT_METHODS +-- +2.19.1 + diff --git a/Latest-fix-proposal-from-Christian-Werner-revert-the.patch b/Latest-fix-proposal-from-Christian-Werner-revert-the.patch new file mode 100644 index 0000000..4a5696e --- /dev/null +++ b/Latest-fix-proposal-from-Christian-Werner-revert-the.patch @@ -0,0 +1,262 @@ +From 37c12f688751bcc6c13ca455d52451c2833aa457 Mon Sep 17 00:00:00 2001 +From: fvogel +Date: Fri, 19 Jan 2018 20:54:18 +0000 +Subject: [PATCH 121/693] Latest fix proposal from Christian Werner: revert the + two previous commits and add XSync() just before the garbage collector, which + minimizes the number of XSync() calls, therefore optimizing performance while + still fixing the bug. + +--- + generic/tkError.c | 28 ++++++++++++++++++---------- + unix/tkUnixColor.c | 1 - + unix/tkUnixEmbed.c | 3 --- + unix/tkUnixFocus.c | 1 - + unix/tkUnixRFont.c | 4 ---- + unix/tkUnixSelect.c | 3 --- + unix/tkUnixSend.c | 1 - + unix/tkUnixWm.c | 9 ++------- + 8 files changed, 20 insertions(+), 30 deletions(-) + +diff --git a/generic/tkError.c b/generic/tkError.c +index fc223e6b3..277d7f0e0 100644 +--- a/generic/tkError.c ++++ b/generic/tkError.c +@@ -82,8 +82,8 @@ Tk_CreateErrorHandler( + * errors. */ + ClientData clientData) /* Arbitrary value to pass to errorProc. */ + { +- register TkErrorHandler *errorPtr; +- register TkDisplay *dispPtr; ++ TkErrorHandler *errorPtr; ++ TkDisplay *dispPtr; + + /* + * Find the display. If Tk doesn't know about this display then it's an +@@ -147,8 +147,8 @@ Tk_DeleteErrorHandler( + Tk_ErrorHandler handler) /* Token for handler to delete; was previous + * return value from Tk_CreateErrorHandler. */ + { +- register TkErrorHandler *errorPtr = (TkErrorHandler *) handler; +- register TkDisplay *dispPtr = errorPtr->dispPtr; ++ TkErrorHandler *errorPtr = (TkErrorHandler *) handler; ++ TkDisplay *dispPtr = errorPtr->dispPtr; + + errorPtr->lastRequest = NextRequest(dispPtr->display) - 1; + +@@ -166,12 +166,20 @@ Tk_DeleteErrorHandler( + + dispPtr->deleteCount += 1; + if (dispPtr->deleteCount >= 10) { +- register TkErrorHandler *prevPtr; ++ TkErrorHandler *prevPtr; + TkErrorHandler *nextPtr; +- int lastSerial; ++ int lastSerial = LastKnownRequestProcessed(dispPtr->display); + ++ /* ++ * Last chance to catch errors for this handler: if no event/error ++ * processing took place to follow up the end of this error handler ++ * we need a round trip with the X server now. ++ */ ++ ++ if (errorPtr->lastRequest > (unsigned long) lastSerial) { ++ XSync(dispPtr->display, False); ++ } + dispPtr->deleteCount = 0; +- lastSerial = LastKnownRequestProcessed(dispPtr->display); + errorPtr = dispPtr->errorPtr; + for (prevPtr = NULL; errorPtr != NULL; errorPtr = nextPtr) { + nextPtr = errorPtr->nextPtr; +@@ -213,11 +221,11 @@ Tk_DeleteErrorHandler( + static int + ErrorProc( + Display *display, /* Display for which error occurred. */ +- register XErrorEvent *errEventPtr) ++ XErrorEvent *errEventPtr) + /* Information about error. */ + { +- register TkDisplay *dispPtr; +- register TkErrorHandler *errorPtr; ++ TkDisplay *dispPtr; ++ TkErrorHandler *errorPtr; + + /* + * See if we know anything about the display. If not, then invoke the +diff --git a/unix/tkUnixColor.c b/unix/tkUnixColor.c +index b11a1ebbc..43500ad5b 100644 +--- a/unix/tkUnixColor.c ++++ b/unix/tkUnixColor.c +@@ -94,7 +94,6 @@ TkpFreeColor( + -1, -1, -1, NULL, NULL); + XFreeColors(DisplayOfScreen(screen), tkColPtr->colormap, + &tkColPtr->color.pixel, 1, 0L); +- XSync(DisplayOfScreen(screen), False); + Tk_DeleteErrorHandler(handler); + } + DeleteStressedCmap(DisplayOfScreen(screen), tkColPtr->colormap); +diff --git a/unix/tkUnixEmbed.c b/unix/tkUnixEmbed.c +index b285fbe73..b170ad037 100644 +--- a/unix/tkUnixEmbed.c ++++ b/unix/tkUnixEmbed.c +@@ -472,7 +472,6 @@ ContainerEventProc( + + Tk_DestroyWindow((Tk_Window) winPtr); + } +- XSync(eventPtr->xfocus.display, False); + Tk_DeleteErrorHandler(errHandler); + } + +@@ -516,7 +515,6 @@ EmbedStructureProc( + containerPtr->wrapper, 0, 0, + (unsigned) Tk_Width((Tk_Window) containerPtr->parentPtr), + (unsigned) Tk_Height((Tk_Window) containerPtr->parentPtr)); +- XSync(eventPtr->xfocus.display, False); + Tk_DeleteErrorHandler(errHandler); + } + } else if (eventPtr->type == DestroyNotify) { +@@ -566,7 +564,6 @@ EmbedFocusProc( + -1, -1, NULL, NULL); + XSetInputFocus(display, containerPtr->wrapper, RevertToParent, + CurrentTime); +- XSync(eventPtr->xfocus.display, False); + Tk_DeleteErrorHandler(errHandler); + } + } +diff --git a/unix/tkUnixFocus.c b/unix/tkUnixFocus.c +index 7f4771e9d..07676181d 100644 +--- a/unix/tkUnixFocus.c ++++ b/unix/tkUnixFocus.c +@@ -112,7 +112,6 @@ TkpChangeFocus( + } + XSetInputFocus(dispPtr->display, winPtr->window, RevertToParent, + CurrentTime); +- XSync(dispPtr->display, False); + Tk_DeleteErrorHandler(errHandler); + + /* +diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c +index 44e733944..d43ed2460 100644 +--- a/unix/tkUnixRFont.c ++++ b/unix/tkUnixRFont.c +@@ -388,7 +388,6 @@ FinishedWithFont( + if (fontPtr->fontset) { + FcFontSetDestroy(fontPtr->fontset); + } +- XSync(fontPtr->display, False); + Tk_DeleteErrorHandler(handler); + } + +@@ -876,7 +875,6 @@ Tk_DrawChars( + Tk_CreateErrorHandler(display, -1, -1, -1, NULL, NULL); + + XftDrawChange(fontPtr->ftDraw, drawable); +- XSync(display, False); + Tk_DeleteErrorHandler(handler); + } + XGetGCValues(display, gc, GCForeground, &values); +@@ -1010,7 +1008,6 @@ TkDrawAngledChars( + Tk_CreateErrorHandler(display, -1, -1, -1, NULL, NULL); + + XftDrawChange(fontPtr->ftDraw, drawable); +- XSync(display, False); + Tk_DeleteErrorHandler(handler); + } + +@@ -1100,7 +1097,6 @@ TkDrawAngledChars( + Tk_CreateErrorHandler(display, -1, -1, -1, NULL, NULL); + + XftDrawChange(fontPtr->ftDraw, drawable); +- XSync(display, False); + Tk_DeleteErrorHandler(handler); + } + XGetGCValues(display, gc, GCForeground, &values); +diff --git a/unix/tkUnixSelect.c b/unix/tkUnixSelect.c +index 9313df5c0..6d379ecc8 100644 +--- a/unix/tkUnixSelect.c ++++ b/unix/tkUnixSelect.c +@@ -470,7 +470,6 @@ TkSelPropProc( + ckfree(propPtr); + } + } +- XSync(eventPtr->xproperty.display, False); + Tk_DeleteErrorHandler(errorHandler); + + /* +@@ -1049,7 +1048,6 @@ ConvertSelection( + reply.xsel.property = incr.multAtoms[1]; + } + XSendEvent(reply.xsel.display, reply.xsel.requestor, False, 0, &reply.ev); +- XSync(reply.xsel.display, False); + Tk_DeleteErrorHandler(errorHandler); + + /* +@@ -1068,7 +1066,6 @@ ConvertSelection( + errorHandler = Tk_CreateErrorHandler(winPtr->display, + -1, -1, -1, (int (*)()) NULL, NULL); + XSelectInput(reply.xsel.display, reply.xsel.requestor, 0L); +- XSync(winPtr->display, False); + Tk_DeleteErrorHandler(errorHandler); + if (tsdPtr->pendingIncrs == &incr) { + tsdPtr->pendingIncrs = incr.nextPtr; +diff --git a/unix/tkUnixSend.c b/unix/tkUnixSend.c +index 0322a78d5..bbbdd774c 100644 +--- a/unix/tkUnixSend.c ++++ b/unix/tkUnixSend.c +@@ -1748,7 +1748,6 @@ AppendPropCarefully( + pendingPtr); + XChangeProperty(display, window, property, XA_STRING, 8, + PropModeAppend, (unsigned char *) value, length); +- XSync(display, False); + Tk_DeleteErrorHandler(handler); + } + +diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c +index 31e14cb72..19ac86cb5 100644 +--- a/unix/tkUnixWm.c ++++ b/unix/tkUnixWm.c +@@ -4084,7 +4084,6 @@ ConfigureEvent( + XMoveResizeWindow(winPtr->display, winPtr->window, 0, + wmPtr->menuHeight, (unsigned) wrapperPtr->changes.width, + (unsigned) (wrapperPtr->changes.height - wmPtr->menuHeight)); +- XSync(winPtr->display, False); + Tk_DeleteErrorHandler(handler); + if ((wmPtr->menubar != NULL) + && ((Tk_Width(wmPtr->menubar) != wrapperPtr->changes.width) +@@ -4421,11 +4420,10 @@ WrapperEventProc( + * Tk_DestroyWindow will try to destroy the window, but of course + * it's already gone. + */ +- Display *display = wmPtr->winPtr->display; + +- handler = Tk_CreateErrorHandler(display, -1, -1, -1, NULL, NULL); ++ handler = Tk_CreateErrorHandler(wmPtr->winPtr->display, -1, -1, -1, ++ NULL, NULL); + Tk_DestroyWindow((Tk_Window) wmPtr->winPtr); +- XSync(display, False); + Tk_DeleteErrorHandler(handler); + } + if (dispPtr->flags & TK_DISPLAY_WM_TRACING) { +@@ -5848,12 +5846,10 @@ Tk_CoordsToWindow( + * deleted + */ + +- XSync(Tk_Display(tkwin), False); + Tk_DeleteErrorHandler(handler); + return NULL; + } + if (child == None) { +- XSync(Tk_Display(tkwin), False); + Tk_DeleteErrorHandler(handler); + return NULL; + } +@@ -5883,7 +5879,6 @@ Tk_CoordsToWindow( + * or below + */ + +- XSync(Tk_Display(tkwin), False); + Tk_DeleteErrorHandler(handler); + handler = NULL; + } +-- +2.19.1 + diff --git a/More-complete-patch-from-Christian-Werner-to-fix-182.patch b/More-complete-patch-from-Christian-Werner-to-fix-182.patch new file mode 100644 index 0000000..f0d5962 --- /dev/null +++ b/More-complete-patch-from-Christian-Werner-to-fix-182.patch @@ -0,0 +1,203 @@ +From 5e200188e783123842b45070a15096262e96f604 Mon Sep 17 00:00:00 2001 +From: fvogel +Date: Wed, 17 Jan 2018 07:18:37 +0000 +Subject: [PATCH 115/693] More complete patch from Christian Werner to fix + [1821174fff] and [1938774fff] + +--- + unix/tkUnixColor.c | 1 + + unix/tkUnixEmbed.c | 3 +++ + unix/tkUnixFocus.c | 1 + + unix/tkUnixRFont.c | 12 +++--------- + unix/tkUnixSelect.c | 3 +++ + unix/tkUnixSend.c | 1 + + unix/tkUnixWm.c | 9 +++++++-- + 7 files changed, 19 insertions(+), 11 deletions(-) + +diff --git a/unix/tkUnixColor.c b/unix/tkUnixColor.c +index 43500ad5b..b11a1ebbc 100644 +--- a/unix/tkUnixColor.c ++++ b/unix/tkUnixColor.c +@@ -94,6 +94,7 @@ TkpFreeColor( + -1, -1, -1, NULL, NULL); + XFreeColors(DisplayOfScreen(screen), tkColPtr->colormap, + &tkColPtr->color.pixel, 1, 0L); ++ XSync(DisplayOfScreen(screen), False); + Tk_DeleteErrorHandler(handler); + } + DeleteStressedCmap(DisplayOfScreen(screen), tkColPtr->colormap); +diff --git a/unix/tkUnixEmbed.c b/unix/tkUnixEmbed.c +index b170ad037..b285fbe73 100644 +--- a/unix/tkUnixEmbed.c ++++ b/unix/tkUnixEmbed.c +@@ -472,6 +472,7 @@ ContainerEventProc( + + Tk_DestroyWindow((Tk_Window) winPtr); + } ++ XSync(eventPtr->xfocus.display, False); + Tk_DeleteErrorHandler(errHandler); + } + +@@ -515,6 +516,7 @@ EmbedStructureProc( + containerPtr->wrapper, 0, 0, + (unsigned) Tk_Width((Tk_Window) containerPtr->parentPtr), + (unsigned) Tk_Height((Tk_Window) containerPtr->parentPtr)); ++ XSync(eventPtr->xfocus.display, False); + Tk_DeleteErrorHandler(errHandler); + } + } else if (eventPtr->type == DestroyNotify) { +@@ -564,6 +566,7 @@ EmbedFocusProc( + -1, -1, NULL, NULL); + XSetInputFocus(display, containerPtr->wrapper, RevertToParent, + CurrentTime); ++ XSync(eventPtr->xfocus.display, False); + Tk_DeleteErrorHandler(errHandler); + } + } +diff --git a/unix/tkUnixFocus.c b/unix/tkUnixFocus.c +index 07676181d..7f4771e9d 100644 +--- a/unix/tkUnixFocus.c ++++ b/unix/tkUnixFocus.c +@@ -112,6 +112,7 @@ TkpChangeFocus( + } + XSetInputFocus(dispPtr->display, winPtr->window, RevertToParent, + CurrentTime); ++ XSync(dispPtr->display, False); + Tk_DeleteErrorHandler(errHandler); + + /* +diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c +index abdde7819..44e733944 100644 +--- a/unix/tkUnixRFont.c ++++ b/unix/tkUnixRFont.c +@@ -388,16 +388,7 @@ FinishedWithFont( + if (fontPtr->fontset) { + FcFontSetDestroy(fontPtr->fontset); + } +- +- /* +- * Synchronize with X server before dropping the error handler. +- * This seems to catch sporadic RenderBadPicture errors on tear +- * down of an application. +- * +- * See bugs [1821174fff] and [1938774fff]. +- */ + XSync(fontPtr->display, False); +- + Tk_DeleteErrorHandler(handler); + } + +@@ -885,6 +876,7 @@ Tk_DrawChars( + Tk_CreateErrorHandler(display, -1, -1, -1, NULL, NULL); + + XftDrawChange(fontPtr->ftDraw, drawable); ++ XSync(display, False); + Tk_DeleteErrorHandler(handler); + } + XGetGCValues(display, gc, GCForeground, &values); +@@ -1018,6 +1010,7 @@ TkDrawAngledChars( + Tk_CreateErrorHandler(display, -1, -1, -1, NULL, NULL); + + XftDrawChange(fontPtr->ftDraw, drawable); ++ XSync(display, False); + Tk_DeleteErrorHandler(handler); + } + +@@ -1107,6 +1100,7 @@ TkDrawAngledChars( + Tk_CreateErrorHandler(display, -1, -1, -1, NULL, NULL); + + XftDrawChange(fontPtr->ftDraw, drawable); ++ XSync(display, False); + Tk_DeleteErrorHandler(handler); + } + XGetGCValues(display, gc, GCForeground, &values); +diff --git a/unix/tkUnixSelect.c b/unix/tkUnixSelect.c +index 6d379ecc8..9313df5c0 100644 +--- a/unix/tkUnixSelect.c ++++ b/unix/tkUnixSelect.c +@@ -470,6 +470,7 @@ TkSelPropProc( + ckfree(propPtr); + } + } ++ XSync(eventPtr->xproperty.display, False); + Tk_DeleteErrorHandler(errorHandler); + + /* +@@ -1048,6 +1049,7 @@ ConvertSelection( + reply.xsel.property = incr.multAtoms[1]; + } + XSendEvent(reply.xsel.display, reply.xsel.requestor, False, 0, &reply.ev); ++ XSync(reply.xsel.display, False); + Tk_DeleteErrorHandler(errorHandler); + + /* +@@ -1066,6 +1068,7 @@ ConvertSelection( + errorHandler = Tk_CreateErrorHandler(winPtr->display, + -1, -1, -1, (int (*)()) NULL, NULL); + XSelectInput(reply.xsel.display, reply.xsel.requestor, 0L); ++ XSync(winPtr->display, False); + Tk_DeleteErrorHandler(errorHandler); + if (tsdPtr->pendingIncrs == &incr) { + tsdPtr->pendingIncrs = incr.nextPtr; +diff --git a/unix/tkUnixSend.c b/unix/tkUnixSend.c +index bbbdd774c..0322a78d5 100644 +--- a/unix/tkUnixSend.c ++++ b/unix/tkUnixSend.c +@@ -1748,6 +1748,7 @@ AppendPropCarefully( + pendingPtr); + XChangeProperty(display, window, property, XA_STRING, 8, + PropModeAppend, (unsigned char *) value, length); ++ XSync(display, False); + Tk_DeleteErrorHandler(handler); + } + +diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c +index 19ac86cb5..31e14cb72 100644 +--- a/unix/tkUnixWm.c ++++ b/unix/tkUnixWm.c +@@ -4084,6 +4084,7 @@ ConfigureEvent( + XMoveResizeWindow(winPtr->display, winPtr->window, 0, + wmPtr->menuHeight, (unsigned) wrapperPtr->changes.width, + (unsigned) (wrapperPtr->changes.height - wmPtr->menuHeight)); ++ XSync(winPtr->display, False); + Tk_DeleteErrorHandler(handler); + if ((wmPtr->menubar != NULL) + && ((Tk_Width(wmPtr->menubar) != wrapperPtr->changes.width) +@@ -4420,10 +4421,11 @@ WrapperEventProc( + * Tk_DestroyWindow will try to destroy the window, but of course + * it's already gone. + */ ++ Display *display = wmPtr->winPtr->display; + +- handler = Tk_CreateErrorHandler(wmPtr->winPtr->display, -1, -1, -1, +- NULL, NULL); ++ handler = Tk_CreateErrorHandler(display, -1, -1, -1, NULL, NULL); + Tk_DestroyWindow((Tk_Window) wmPtr->winPtr); ++ XSync(display, False); + Tk_DeleteErrorHandler(handler); + } + if (dispPtr->flags & TK_DISPLAY_WM_TRACING) { +@@ -5846,10 +5848,12 @@ Tk_CoordsToWindow( + * deleted + */ + ++ XSync(Tk_Display(tkwin), False); + Tk_DeleteErrorHandler(handler); + return NULL; + } + if (child == None) { ++ XSync(Tk_Display(tkwin), False); + Tk_DeleteErrorHandler(handler); + return NULL; + } +@@ -5879,6 +5883,7 @@ Tk_CoordsToWindow( + * or below + */ + ++ XSync(Tk_Display(tkwin), False); + Tk_DeleteErrorHandler(handler); + handler = NULL; + } +-- +2.19.1 + diff --git a/More-general-error-message-since-it-can-be-raised-no.patch b/More-general-error-message-since-it-can-be-raised-no.patch new file mode 100644 index 0000000..970357a --- /dev/null +++ b/More-general-error-message-since-it-can-be-raised-no.patch @@ -0,0 +1,26 @@ +From eabf7dee83847addd7293f223b8604abe6adc485 Mon Sep 17 00:00:00 2001 +From: fvogel +Date: Fri, 24 Aug 2018 21:47:21 +0000 +Subject: [PATCH 295/693] More general error message, since it can be raised + not only because of an empty -children option value + +--- + generic/ttk/ttkLayout.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/generic/ttk/ttkLayout.c b/generic/ttk/ttkLayout.c +index 924355aa6..1bad8c7a8 100644 +--- a/generic/ttk/ttkLayout.c ++++ b/generic/ttk/ttkLayout.c +@@ -702,7 +702,7 @@ Ttk_LayoutTemplate Ttk_ParseLayoutTemplate(Tcl_Interp *interp, Tcl_Obj *objPtr) + if (childSpec) { + tail->child = Ttk_ParseLayoutTemplate(interp, childSpec); + if (!tail->child) { +- Tcl_SetObjResult(interp, Tcl_ObjPrintf("Empty -children value")); ++ Tcl_SetObjResult(interp, Tcl_ObjPrintf("Invalid -children value")); + Tcl_SetErrorCode(interp, "TTK", "VALUE", "LAYOUT", NULL); + goto error; + } +-- +2.19.1 + diff --git a/Third-fix-proposal-for-4b555aca34-text-search-all-ha.patch b/Third-fix-proposal-for-4b555aca34-text-search-all-ha.patch new file mode 100644 index 0000000..adb1879 --- /dev/null +++ b/Third-fix-proposal-for-4b555aca34-text-search-all-ha.patch @@ -0,0 +1,28 @@ +From c42964a52a7dbb003356da456afc992b9eecb377 Mon Sep 17 00:00:00 2001 +From: fvogel +Date: Mon, 15 Oct 2018 18:58:49 +0000 +Subject: [PATCH 357/693] Third fix proposal for [4b555aca34]: text search -all + hangs and eats all memory. (And fix test text-22.229) + +--- + generic/tkText.c | 3 ++- + tests/text.test | 2 +- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/generic/tkText.c b/generic/tkText.c +index e49693edc..7dfd0483d 100644 +--- a/generic/tkText.c ++++ b/generic/tkText.c +@@ -6090,7 +6090,8 @@ SearchCore( + alreadySearchOffset -= matchLength; + } + } else { +- firstOffset = p - startOfLine + matchLength; ++ firstOffset = (matchLength == 0) ? p - startOfLine + 1 ++ : p - startOfLine + matchLength; + if (firstOffset >= lastOffset) { + /* + * Now, we have to be careful not to find +-- +2.19.1 + diff --git a/bugfix-branch-for-6fcaaa6f80.patch b/bugfix-branch-for-6fcaaa6f80.patch new file mode 100644 index 0000000..8d6ebc8 --- /dev/null +++ b/bugfix-branch-for-6fcaaa6f80.patch @@ -0,0 +1,35 @@ +From 8fed49c19d7ff190c54ff8182a49ff887b56036a Mon Sep 17 00:00:00 2001 +From: bll +Date: Fri, 31 Aug 2018 15:31:13 +0000 +Subject: [PATCH 301/693] bugfix branch for: [6fcaaa6f80] Fix position of + insertion cursor for ttk entry. Patch provided by Csaba Nemethi. + +--- + generic/ttk/ttkEntry.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c +index 83f1a38e5..f476dc9e2 100644 +--- a/generic/ttk/ttkEntry.c ++++ b/generic/ttk/ttkEntry.c +@@ -1257,9 +1257,16 @@ static void EntryDisplay(void *clientData, Drawable d) + /* @@@ should: maybe: SetCaretPos even when blinked off */ + Tk_SetCaretPos(tkwin, cursorX, cursorY, cursorHeight); + ++ cursorX -= cursorWidth/2; ++ if (cursorX < textarea.x) { ++ cursorX = textarea.x; ++ } else if (cursorX + cursorWidth > textarea.x + textarea.width) { ++ cursorX = textarea.x + textarea.width - cursorWidth; ++ } ++ + gc = EntryGetGC(entryPtr, es.insertColorObj, clipRegion); + XFillRectangle(Tk_Display(tkwin), d, gc, +- cursorX-cursorWidth/2, cursorY, cursorWidth, cursorHeight); ++ cursorX, cursorY, cursorWidth, cursorHeight); + XSetClipMask(Tk_Display(tkwin), gc, None); + Tk_FreeGC(Tk_Display(tkwin), gc); + } +-- +2.19.1 + diff --git a/fix-bug-18a4ba19bd-winfo-containing-gives-wrong-answ.patch b/fix-bug-18a4ba19bd-winfo-containing-gives-wrong-answ.patch new file mode 100644 index 0000000..f2a1f8d --- /dev/null +++ b/fix-bug-18a4ba19bd-winfo-containing-gives-wrong-answ.patch @@ -0,0 +1,62 @@ +From fc0267a0bf485c9a753b488bf4df90b62b555317 Mon Sep 17 00:00:00 2001 +From: culler +Date: Tue, 11 Dec 2018 19:55:11 +0000 +Subject: [PATCH 542/693] fix bug [18a4ba19bd]: winfo containing gives wrong + answer on linux. + +--- + unix/tkUnixWm.c | 24 +++++++++--------------- + 1 file changed, 9 insertions(+), 15 deletions(-) + +diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c +index 19ac86cb5..399916ff3 100644 +--- a/unix/tkUnixWm.c ++++ b/unix/tkUnixWm.c +@@ -5855,16 +5855,15 @@ Tk_CoordsToWindow( + } + for (wmPtr = (WmInfo *) dispPtr->firstWmPtr; wmPtr != NULL; + wmPtr = wmPtr->nextPtr) { +- if (wmPtr->reparent == child) { +- goto gotToplevel; +- } +- if (wmPtr->wrapperPtr != NULL) { +- if (child == wmPtr->wrapperPtr->window) { +- goto gotToplevel; +- } +- } else if (child == wmPtr->winPtr->window) { +- goto gotToplevel; +- } ++ winPtr = wmPtr->winPtr; ++ if (wmPtr->winPtr == NULL) { ++ continue; ++ } ++ if (x >= winPtr->changes.x && ++ x < winPtr->changes.x + winPtr->changes.width && ++ y < winPtr->changes.y + winPtr->changes.height) { ++ goto gotToplevel; ++ } + } + x = childX; + y = childY; +@@ -5882,7 +5881,6 @@ Tk_CoordsToWindow( + Tk_DeleteErrorHandler(handler); + handler = NULL; + } +- winPtr = wmPtr->winPtr; + if (winPtr->mainPtr != ((TkWindow *) tkwin)->mainPtr) { + return NULL; + } +@@ -5897,10 +5895,6 @@ Tk_CoordsToWindow( + + x = childX - winPtr->changes.x; + y = childY - winPtr->changes.y; +- if ((x < 0) || (x >= winPtr->changes.width) +- || (y >= winPtr->changes.height)) { +- return NULL; +- } + if (y < 0) { + winPtr = (TkWindow *) wmPtr->menubar; + if (winPtr == NULL) { +-- +2.19.1 + diff --git a/gif-read-not-complete-on-overflow-image-information-.patch b/gif-read-not-complete-on-overflow-image-information-.patch new file mode 100644 index 0000000..367dc03 --- /dev/null +++ b/gif-read-not-complete-on-overflow-image-information-.patch @@ -0,0 +1,53 @@ +From 17fc6d054e41444b64b3f56bdca60b2765402071 Mon Sep 17 00:00:00 2001 +From: oehhar +Date: Sun, 3 Feb 2019 11:21:11 +0000 +Subject: [PATCH 644/693] gif read not complete on overflow image - information + missinterpreted if following subimage is querried [4da2191b] + +--- + generic/tkImgGIF.c | 21 ++++++++++++++++++++- + tests/imgPhoto.test | 33 +++++++++++++++++++++++++++++++++ + 2 files changed, 53 insertions(+), 1 deletion(-) + +diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c +index 7c4872bef..fa4b728d3 100644 +--- a/generic/tkImgGIF.c ++++ b/generic/tkImgGIF.c +@@ -1034,7 +1034,7 @@ ReadImage( + int transparent) + { + unsigned char initialCodeSize; +- int xpos = 0, ypos = 0, pass = 0, i; ++ int xpos = 0, ypos = 0, pass = 0, i, count; + register unsigned char *pixelPtr; + static const int interlaceStep[] = { 8, 8, 4, 2 }; + static const int interlaceStart[] = { 0, 4, 2, 1 }; +@@ -1252,6 +1252,25 @@ ReadImage( + } + pixelPtr = imagePtr + (ypos) * len * ((transparent>=0)?4:3); + } ++ ++ /* ++ * Now read until the final zero byte. ++ * It was observed that there might be 1 length blocks ++ * (test imgPhoto-14.1) which are not read. ++ * ++ * The field "stack" is abused for temporary buffer. it has 4096 bytes ++ * and we need 256. ++ * ++ * Loop until we hit a 0 length block which is the end sign. ++ */ ++ while ( 0 < (count = GetDataBlock(gifConfPtr, chan, stack))) ++ { ++ if (-1 == count ) { ++ Tcl_SetObjResult(interp, Tcl_ObjPrintf( ++ "error reading GIF image: %s", Tcl_PosixError(interp))); ++ return TCL_ERROR; ++ } ++ } + return TCL_OK; + } + +-- +2.19.1 + diff --git a/tk-8.6.5-fix-xft.patch b/tk-8.6.5-fix-xft.patch new file mode 100644 index 0000000..de10c9d --- /dev/null +++ b/tk-8.6.5-fix-xft.patch @@ -0,0 +1,15 @@ +diff --git a/unix/configure.in b/unix/configure.in +index cb412af..abfd43b 100755 +--- a/unix/configure.in ++++ b/unix/configure.in +@@ -479,8 +479,8 @@ if test $tk_aqua = no; then + XFT_LIBS=`xft-config --libs 2>/dev/null` || found_xft="no" + if test "$found_xft" = "no" ; then + found_xft=yes +- XFT_CFLAGS=`pkg-config --cflags xft 2>/dev/null` || found_xft="no" +- XFT_LIBS=`pkg-config --libs xft 2>/dev/null` || found_xft="no" ++ XFT_CFLAGS=`pkg-config --cflags xft freetype2 2>/dev/null` || found_xft="no" ++ XFT_LIBS=`pkg-config --libs xft freetype2 2>/dev/null` || found_xft="no" + fi + AC_MSG_RESULT([$found_xft]) + dnl make sure that compiling against Xft header file doesn't bomb diff --git a/tk-8.6.5-make.patch b/tk-8.6.5-make.patch new file mode 100644 index 0000000..1ede285 --- /dev/null +++ b/tk-8.6.5-make.patch @@ -0,0 +1,13 @@ +diff --git a/unix/Makefile.in b/unix/Makefile.in +index 96f1408..05270c6 100644 +--- a/unix/Makefile.in ++++ b/unix/Makefile.in +@@ -739,7 +739,7 @@ install-binaries: $(TK_STUB_LIB_FILE) $(TK_LIB_FILE) ${WISH_EXE} + fi + @echo "Installing $(LIB_FILE) to $(DLL_INSTALL_DIR)/" + @@INSTALL_LIB@ +- @chmod 555 "$(DLL_INSTALL_DIR)/$(LIB_FILE)" ++ @chmod 755 "$(DLL_INSTALL_DIR)/$(LIB_FILE)" + @if test -f "tk${MAJOR_VERSION}${MINOR_VERSION}.dll"; then \ + $(INSTALL_LIBRARY) "tk${MAJOR_VERSION}${MINOR_VERSION}.dll" "$(DLL_INSTALL_DIR)";\ + chmod 555 "$(DLL_INSTALL_DIR)/tk${MAJOR_VERSION}${MINOR_VERSION}.dll";\ diff --git a/tk-8.6.7-conf.patch b/tk-8.6.7-conf.patch new file mode 100644 index 0000000..b5dfb16 --- /dev/null +++ b/tk-8.6.7-conf.patch @@ -0,0 +1,19 @@ +diff --git a/unix/tcl.m4 b/unix/tcl.m4 +index 8a802fb..46a08c1 100644 +--- a/unix/tcl.m4 ++++ b/unix/tcl.m4 +@@ -1402,12 +1402,12 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ + # get rid of the warnings. + #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" + +- SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}' ++ SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS} -Wl,-soname,${@}' + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,--export-dynamic" + AS_IF([test $doRpath = yes], [ +- CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}']) ++ CC_SEARCH_FLAGS='']) + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + AS_IF([test "`uname -m`" = "alpha"], [CFLAGS="$CFLAGS -mieee"]) + AS_IF([test $do64bit = yes], [ diff --git a/tk-8.6.7-no-fonts-fix.patch b/tk-8.6.7-no-fonts-fix.patch new file mode 100644 index 0000000..f3e3d04 --- /dev/null +++ b/tk-8.6.7-no-fonts-fix.patch @@ -0,0 +1,13 @@ +diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c +index cce59a8..78df47a 100644 +--- a/unix/tkUnixRFont.c ++++ b/unix/tkUnixRFont.c +@@ -271,7 +271,7 @@ InitFont( + */ + + set = FcFontSort(0, pattern, FcTrue, NULL, &result); +- if (!set) { ++ if (!set || set->nfont == 0) { + ckfree(fontPtr); + return NULL; + } diff --git a/tk.spec b/tk.spec new file mode 100644 index 0000000..d409aa4 --- /dev/null +++ b/tk.spec @@ -0,0 +1,123 @@ +%define majorver 8.6 +%define epoch 1 + +Name: tk +Version: 8.6.8 +Release: 2 +Summary: The graphical toolkit for the Tcl scripting language +Epoch: 1 +License: TCL +URL: http://tcl.sourceforge.net +Source0: http://download.sourceforge.net/sourceforge/tcl/%{name}%{version}-src.tar.gz +Requires: tcl = %{epoch}:%{version} glibc +BuildRequires: tcl-devel = %{epoch}:%{version} autoconf libX11-devel libXft-devel + +Conflicts: itcl <= 3.2 +Obsoletes: tile <= 0.8.2 +Provides: tile = 0.8.2 +#Acknowledge patches 0001-0004 from redhat or fedora. +Patch0001: tk-8.6.5-make.patch +Patch0002: tk-8.6.7-conf.patch +Patch0003: tk-8.6.5-fix-xft.patch +Patch0004: tk-8.6.7-no-fonts-fix.patch + +Patch6001: Bugfix-4966cad4d4-Now-function-NotebookPlaceSlaves-i.patch +Patch6002: Fix-382712ade6-X11-event-generate-.-KeyPress-segfaul.patch +Patch6003: Fix-657c389120-and-b4214b4712-Segfault-when-destroyi.patch +Patch6004: Fix-1821174fff-and-1938774fff-RenderBadPicture-inval.patch +Patch6005: More-complete-patch-from-Christian-Werner-to-fix-182.patch +Patch6006: Fix-broken-build-one-line-of-the-patch-was-missing.patch +Patch6007: Latest-fix-proposal-from-Christian-Werner-revert-the.patch +Patch6008: Fix-5d991b822e-segmentation-violation-in-TclObjLooku.patch +Patch6009: Fix-502e74e9ad-crash-for-untrusted-X-connections-for.patch +Patch6010: Further-patch-from-Christian-Werner-on-the-observati.patch +Patch6011: Fix-de01e24aa1-Text-replace-command-involving-select.patch +Patch6012: Fix-fbaed1f66b-image-create-photo-errors-out-on-a-sa.patch +Patch6013: Fix-3441086fff-ttk-style-layout-with-empty-children-.patch +Patch6014: More-general-error-message-since-it-can-be-raised-no.patch +Patch6015: bugfix-branch-for-6fcaaa6f80.patch +Patch6016: Fix-6437e8d00d-font-24.5-test-fails-on-macOS-and-Lin.patch +Patch6017: Fix-4b555aca34-text-search-all-hangs-and-eats-all-me.patch +Patch6018: Another-proposed-fix-for-4b555aca34-text-search-all-.patch +Patch6019: Third-fix-proposal-for-4b555aca34-text-search-all-ha.patch +Patch6020: Fix-6b22d436aa-Treeview-ActivateHeading-Binding-Fail.patch +Patch6021: Crash-prevention.-Still-buggy-now-test-text-11a.22-f.patch +Patch6022: fix-bug-18a4ba19bd-winfo-containing-gives-wrong-answ.patch +Patch6023: Avoid-errors-when-a-menu-is-destroyed-before-its-pos.patch +Patch6024: gif-read-not-complete-on-overflow-image-information-.patch + +%description +TK is a widget toolkit that creates graphical user interface(GUI). It's +especially easy to program a GUI application using tcl script language. + + +%package devel +Summary: Tk graphical toolkit development files +Requires: %{name} = %{epoch}:%{version}-%{release} libX11-devel libXft-devel tcl-devel = %{epoch}:%{version} + +%description devel +Package devel includes files for developing with tk. + +%package help +Summary: Documents for tf + +%description help +Includes Man pages for tf. + +%prep +%autosetup -n %{name}%{version} -p1 + +%build +cd unix +autoconf +%configure --enable-threads +%make_build CFLAGS="%{optflags}" TK_LIBRARY=%{_datadir}/%{name}%{majorver} + +%install +%make_install -C unix INSTALL_ROOT=%{buildroot} TK_LIBRARY=%{_datadir}/%{name}%{majorver} + +ln -s wish%{majorver} %{buildroot}%{_bindir}/wish +ln -s lib%{name}%{majorver}.so %{buildroot}%{_libdir}/lib%{name}.so + +install -d %{buildroot}/%{_includedir}/%{name}-private/{generic/ttk,unix} +find generic unix -name "*.h" -exec cp -p '{}' %{buildroot}/%{_includedir}/%{name}-private/'{}' ';' +( cd %{buildroot}/%{_includedir} + for i in *.h ; do + [ -f %{buildroot}/%{_includedir}/%{name}-private/generic/$i ] && ln -sf ../../$i %{buildroot}/%{_includedir}/%{name}-private/generic ; + done +) + +sed -i -e "s|$PWD/unix|%{_libdir}|; s|$PWD|%{_includedir}/%{name}-private|" %{buildroot}/%{_libdir}/%{name}Config.sh + +%pre +[ ! -h %{_prefix}/%{_lib}/%{name}%{majorver} ] || rm %{_prefix}/%{_lib}/%{name}%{majorver} + +%ldconfig_post +%ldconfig_postun + +%files +%doc README changes license.terms +%defattr(-,root,root,-) +%{_bindir}/wish* +%{_datadir}/%{name}%{majorver} +%exclude %{_datadir}/%{name}%{majorver}/tkAppInit.c +%{_libdir}/lib%{name}%{majorver}.so +%{_libdir}/%{name}%{majorver} + +%files devel +%defattr(-,root,root) +%{_includedir}/* +%{_libdir}/lib%{name}.so +%{_libdir}/lib%{name}stub%{majorver}.a +%{_libdir}/%{name}Config.sh +%{_libdir}/pkgconfig/tk.pc +%{_datadir}/%{name}%{majorver}/tkAppInit.c + +%files help +%{_mandir}/man1/* +%{_mandir}/mann/* +%{_mandir}/man3/* + +%changelog +* Wed Sep 18 2019 Zaiwang Li - 1:8.6.8-2 +- Init package diff --git a/tk8.6.8-src.tar.gz b/tk8.6.8-src.tar.gz new file mode 100644 index 0000000..21cbb48 Binary files /dev/null and b/tk8.6.8-src.tar.gz differ