summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-07-12 15:51:26 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-07-12 15:51:26 (GMT)
commit3ebf832d92b4ac8ff72989f40f59146eb3fc6f67 (patch)
treedd7cec8f6b4283c39c8c969c3b25980f9c2a20a3 /generic
parent8b94c471d7cb1f24b1e22e5c64f90197d220fbe2 (diff)
parentce1d35c813ae7774af4bbd3f1cc5d3a1f0c8cac6 (diff)
downloadtk-3ebf832d92b4ac8ff72989f40f59146eb3fc6f67.zip
tk-3ebf832d92b4ac8ff72989f40f59146eb3fc6f67.tar.gz
tk-3ebf832d92b4ac8ff72989f40f59146eb3fc6f67.tar.bz2
Merge 8.6
Diffstat (limited to 'generic')
-rw-r--r--generic/tkBind.c102
-rw-r--r--generic/tkCanvPs.c4
-rw-r--r--generic/tkCanvas.c8
-rw-r--r--generic/tkEntry.c16
-rw-r--r--generic/tkImgPhoto.c41
-rw-r--r--generic/tkInt.h2
-rw-r--r--generic/tkListbox.c8
-rw-r--r--generic/tkMenu.c2
-rw-r--r--generic/tkText.c2
-rw-r--r--generic/tkTextDisp.c8
-rw-r--r--generic/tkTextTag.c2
-rw-r--r--generic/tkWindow.c2
-rw-r--r--generic/ttk/ttkEntry.c2
13 files changed, 136 insertions, 63 deletions
diff --git a/generic/tkBind.c b/generic/tkBind.c
index e9d5b3a..b3bddc9 100644
--- a/generic/tkBind.c
+++ b/generic/tkBind.c
@@ -59,7 +59,9 @@
/*
* In old implementation (the one that used an event ring), <Double-1> and <1><1> were
- * equivalent sequences. However it is logical to give <Double-1> higher precedence.
+ * equivalent sequences. However it is logical to give <Double-1> higher precedence
+ * since it is more specific. Indeed <Double-1> includes time and space requirements,
+ * which is not the case for <1><1>.
* This can be achieved by setting PREFER_MOST_SPECIALIZED_EVENT to 1.
*/
@@ -846,6 +848,20 @@ CountSpecialized(
return sndCount - fstCount;
}
+int
+IsKeyEventType(
+ unsigned eventType)
+{
+ return eventType == KeyPress || eventType == KeyRelease;
+}
+
+int
+IsButtonEventType(
+ unsigned eventType)
+{
+ return eventType == ButtonPress || eventType == ButtonRelease;
+}
+
static int
MatchEventNearby(
const XEvent *lhs, /* previous button event */
@@ -853,7 +869,7 @@ MatchEventNearby(
{
assert(lhs);
assert(rhs);
- assert(lhs->type == ButtonPress || lhs->type == ButtonRelease);
+ assert(IsButtonEventType(lhs->type));
assert(lhs->type == rhs->type);
/* assert: lhs->xbutton.time <= rhs->xbutton.time */
@@ -865,16 +881,16 @@ MatchEventNearby(
static int
MatchEventRepeat(
- const XEvent *lhs, /* previous key event */
- const XEvent *rhs) /* current key event */
+ const XKeyEvent *lhs, /* previous key event */
+ const XKeyEvent *rhs) /* current key event */
{
assert(lhs);
assert(rhs);
- assert(lhs->type == KeyPress || lhs->type == KeyRelease);
+ assert(IsKeyEventType(lhs->type));
assert(lhs->type == rhs->type);
- /* assert: lhs->xkey.time <= rhs->xkey.time */
- return TestNearbyTime(rhs->xkey.time, lhs->xkey.time);
+ /* assert: lhs->time <= rhs->time */
+ return lhs->keycode == rhs->keycode && TestNearbyTime(lhs->time, rhs->time);
}
static void
@@ -2199,7 +2215,7 @@ Tk_BindEvent(
* Ignore the event completely if it is an Enter, Leave, FocusIn, or
* FocusOut event with detail NotifyInferior. The reason for ignoring
* these events is that we don't want transitions between a window and its
- * children to visible to bindings on the parent: this would cause
+ * children to be visible to bindings on the parent: this would cause
* problems for mega-widgets, since the internal structure of a
* mega-widget isn't supposed to be visible to people watching the parent.
*
@@ -2283,7 +2299,7 @@ Tk_BindEvent(
switch (eventPtr->type) {
case KeyPress:
case KeyRelease:
- if (MatchEventRepeat(&curEvent->xev, eventPtr)) {
+ if (MatchEventRepeat(&curEvent->xev.xkey, &eventPtr->xkey)) {
if (curEvent->xev.xkey.keycode == eventPtr->xkey.keycode) {
++curEvent->countDetailed;
} else {
@@ -2507,13 +2523,13 @@ Tk_BindEvent(
switch (patPtr->eventType) {
case ButtonPress:
case ButtonRelease:
- if (curEvent->xev.type == KeyPress || curEvent->xev.type == KeyRelease) {
+ if (IsKeyEventType(curEvent->xev.type)) {
RemoveListEntry(&bindPtr->lookupTables.entryPool, psEntry);
}
break;
case KeyPress:
case KeyRelease:
- if (curEvent->xev.type == ButtonPress || curEvent->xev.type == ButtonRelease) {
+ if (IsButtonEventType(curEvent->xev.type)) {
RemoveListEntry(&bindPtr->lookupTables.entryPool, psEntry);
}
break;
@@ -2772,6 +2788,7 @@ MatchPatterns(
PatSeq *bestPhysPtr;
ModMask bestModMask;
const PSModMaskArr *bestModMaskArr = NULL;
+ int i, isModKeyOnly = 0;
assert(dispPtr);
assert(bindPtr);
@@ -2786,6 +2803,26 @@ MatchPatterns(
bestPhysPtr = NULL;
window = curEvent->xev.xany.window;
+ /*
+ * Modifier key events interlaced between patterns parts of a
+ * sequence shall not prevent a sequence from ultimately
+ * matching. Example: when trying to trigger <a><Control-c>
+ * from the keyboard, the sequence of events actually seen is
+ * <a> then <Control_L> (possibly repeating if the key is hold
+ * down), and finally <Control-c>. At the time <Control_L> is
+ * seen, we shall keep the <a><Control-c> pattern sequence in
+ * the promotion list, otherwise it is impossible to trigger
+ * it from the keyboard. See bug [16ef161925].
+ */
+ if (IsKeyEventType(curEvent->xev.type)) {
+ for (i = 0; i < dispPtr->numModKeyCodes; ++i) {
+ if (dispPtr->modKeyCodes[i] == curEvent->xev.xkey.keycode) {
+ isModKeyOnly = 1;
+ break;
+ }
+ }
+ }
+
for (psEntry = PSList_First(psList); psEntry; psEntry = PSList_Next(psEntry)) {
if (patIndex == 0 || psEntry->window == window) {
PatSeq* psPtr = psEntry->psPtr;
@@ -2800,6 +2837,12 @@ MatchPatterns(
: VirtPatIsBound(bindPtr, psPtr, object, physPtrPtr)) {
TkPattern *patPtr = psPtr->pats + patIndex;
+ /* ignore modifier key events, and KeyRelease events if the current event
+ * is of a different type (e.g. a Button event)
+ */
+ psEntry->keepIt = isModKeyOnly || \
+ ((patPtr->eventType != (unsigned) curEvent->xev.type) && curEvent->xev.type == KeyRelease);
+
if (patPtr->eventType == (unsigned) curEvent->xev.type
&& (curEvent->xev.type != CreateNotify
|| curEvent->xev.xcreatewindow.parent == window)
@@ -2814,8 +2857,9 @@ MatchPatterns(
ModMask curModMask = ResolveModifiers(dispPtr, bindPtr->curModMask);
psEntry->expired = 1; /* remove it from promotion list */
+ psEntry->keepIt = 0; /* don't keep matching patterns */
- if ((modMask & ~curModMask) == 0) {
+ if (IsSubsetOf(modMask, curModMask)) {
unsigned count = patPtr->info ? curEvent->countDetailed : curEvent->countAny;
if (patIndex < PSModMaskArr_Size(psEntry->lastModMaskArr)) {
@@ -3462,7 +3506,7 @@ DeleteVirtualEventTable(
* already defined, the new definition augments those that already exist.
*
* Results:
- * The return value is TCL_ERROR if an error occured while creating the
+ * The return value is TCL_ERROR if an error occurred while creating the
* virtual binding. In this case, an error message will be left in the
* interp's result. If all went well then the return value is TCL_OK.
*
@@ -4344,17 +4388,6 @@ HandleEventGenerate(
}
/*
- * Now we have constructed the event, inject it into the event handling
- * code.
- */
-
- if (synch) {
- Tk_HandleEvent(&event.general);
- } else {
- Tk_QueueWindowEvent(&event.general, pos);
- }
-
- /*
* We only allow warping if the window is mapped.
*/
@@ -4363,11 +4396,6 @@ HandleEventGenerate(
Tk_Window warpWindow = Tk_IdToWindow(dispPtr->display, event.general.xmotion.window);
- if (!(dispPtr->flags & TK_DISPLAY_IN_WARP)) {
- Tcl_DoWhenIdle(DoWarp, dispPtr);
- dispPtr->flags |= TK_DISPLAY_IN_WARP;
- }
-
if (warpWindow != dispPtr->warpWindow) {
if (warpWindow) {
Tcl_Preserve(warpWindow);
@@ -4380,6 +4408,22 @@ HandleEventGenerate(
dispPtr->warpMainwin = mainWin;
dispPtr->warpX = event.general.xmotion.x;
dispPtr->warpY = event.general.xmotion.y;
+
+ if (!(dispPtr->flags & TK_DISPLAY_IN_WARP)) {
+ Tcl_DoWhenIdle(DoWarp, dispPtr);
+ dispPtr->flags |= TK_DISPLAY_IN_WARP;
+ }
+ }
+
+ /*
+ * Now we have constructed the event, inject it into the event handling
+ * code.
+ */
+
+ if (synch) {
+ Tk_HandleEvent(&event.general);
+ } else {
+ Tk_QueueWindowEvent(&event.general, pos);
}
}
diff --git a/generic/tkCanvPs.c b/generic/tkCanvPs.c
index 2cb4d27..1a8b3d3 100644
--- a/generic/tkCanvPs.c
+++ b/generic/tkCanvPs.c
@@ -193,7 +193,7 @@ TkCanvPostscriptCmd(
* such.
*/
- result = Tcl_EvalEx(interp, "::tk::ensure_psenc_is_loaded", -1, 0);
+ result = Tcl_EvalEx(interp, "::tk::ensure_psenc_is_loaded", -1, TCL_EVAL_GLOBAL);
if (result != TCL_OK) {
return result;
}
@@ -1601,7 +1601,7 @@ Tk_PostscriptPhoto(
/*
* Generate data for image in monochrome mode. No attempt at
* dithering is made--instead, just set a threshold. To handle
- * transparecies we need to output two lines: one for the black
+ * transparencies we need to output two lines: one for the black
* pixels, one for the white ones.
*/
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index 4d68ade..9f661bc 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -5556,8 +5556,8 @@ CanvasUpdateScrollbars(
Tcl_DString buf;
/*
- * Save all the relevant values from the canvasPtr, because it might be
- * deleted as part of either of the two calls to Tcl_VarEval below.
+ * Preserve the relevant values from the canvasPtr, because it might be
+ * deleted as part of either of the two calls to Tcl_EvalEx below.
*/
interp = canvasPtr->interp;
@@ -5588,7 +5588,7 @@ CanvasUpdateScrollbars(
Tcl_DStringAppend(&buf, xScrollCmd, -1);
Tcl_DStringAppend(&buf, " ", -1);
Tcl_DStringAppend(&buf, Tcl_GetString(fractions), -1);
- result = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0);
+ result = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, TCL_EVAL_GLOBAL);
Tcl_DStringFree(&buf);
Tcl_DecrRefCount(fractions);
if (result != TCL_OK) {
@@ -5606,7 +5606,7 @@ CanvasUpdateScrollbars(
Tcl_DStringAppend(&buf, yScrollCmd, -1);
Tcl_DStringAppend(&buf, " ", -1);
Tcl_DStringAppend(&buf, Tcl_GetString(fractions), -1);
- result = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0);
+ result = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, TCL_EVAL_GLOBAL);
Tcl_DStringFree(&buf);
Tcl_DecrRefCount(fractions);
if (result != TCL_OK) {
diff --git a/generic/tkEntry.c b/generic/tkEntry.c
index fc5ba63..8141daf 100644
--- a/generic/tkEntry.c
+++ b/generic/tkEntry.c
@@ -3007,7 +3007,7 @@ EntryUpdateScrollbar(
Tcl_DStringAppend(&buf, firstStr, -1);
Tcl_DStringAppend(&buf, " ", -1);
Tcl_DStringAppend(&buf, lastStr, -1);
- code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0);
+ code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, TCL_EVAL_GLOBAL);
Tcl_DStringFree(&buf);
if (code != TCL_OK) {
Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
@@ -3268,7 +3268,7 @@ EntryValidate(
*
* Results:
* TCL_OK if the validatecommand accepts the new string, TCL_ERROR if any
- * problems occured with validatecommand.
+ * problems occurred with validatecommand.
*
* Side effects:
* The insertion/deletion may be aborted, and the validatecommand might
@@ -3293,17 +3293,21 @@ EntryValidateChange(
if (entryPtr->validateCmd == NULL ||
entryPtr->validate == VALIDATE_NONE) {
+ if (entryPtr->flags & VALIDATING) {
+ entryPtr->flags |= VALIDATE_ABORT;
+ }
return (varValidate ? TCL_ERROR : TCL_OK);
}
/*
- * If we're already validating, then we're hitting a loop condition Return
- * and set validate to 0 to disallow further validations and prevent
- * current validation from finishing
+ * If we're already validating, then we're hitting a loop condition. Set
+ * validate to none to disallow further validations, arrange for flags
+ * to prevent current validation from finishing, and return.
*/
if (entryPtr->flags & VALIDATING) {
entryPtr->validate = VALIDATE_NONE;
+ entryPtr->flags |= VALIDATE_ABORT;
return (varValidate ? TCL_ERROR : TCL_OK);
}
@@ -3325,7 +3329,7 @@ EntryValidateChange(
/*
* If e->validate has become VALIDATE_NONE during the validation, or we
* now have VALIDATE_VAR set (from EntrySetValue) and didn't before, it
- * means that a loop condition almost occured. Do not allow this
+ * means that a loop condition almost occurred. Do not allow this
* validation result to finish.
*/
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c
index 96c3743..26b0446 100644
--- a/generic/tkImgPhoto.c
+++ b/generic/tkImgPhoto.c
@@ -1106,6 +1106,7 @@ ImgPhotoCmd(
Tcl_SetObjResult(interp, Tcl_NewStringObj(
TK_PHOTO_ALLOC_FAILURE_MESSAGE, -1));
Tcl_SetErrorCode(interp, "TK", "MALLOC", NULL);
+ Tcl_Close(NULL, chan);
return TCL_ERROR;
}
}
@@ -2771,8 +2772,21 @@ Tk_PhotoPutBlock(
if (sourceBlock.pixelPtr >= masterPtr->pix32
&& sourceBlock.pixelPtr <= masterPtr->pix32 + masterPtr->width
* masterPtr->height * 4) {
- sourceBlock.pixelPtr = attemptckalloc(sourceBlock.height
- * sourceBlock.pitch);
+ /*
+ * Fix 5c51be6411: avoid reading
+ *
+ * (sourceBlock.pitch - sourceBlock.width * sourceBlock.pixelSize)
+ *
+ * bytes past the end of masterPtr->pix32[] when
+ *
+ * blockPtr->pixelPtr > (masterPtr->pix32 +
+ * 4 * masterPtr->width * masterPtr->height -
+ * sourceBlock.height * sourceBlock.pitch)
+ */
+ unsigned int cpyLen = (sourceBlock.height - 1) * sourceBlock.pitch +
+ sourceBlock.width * sourceBlock.pixelSize;
+
+ sourceBlock.pixelPtr = attemptckalloc(cpyLen);
if (sourceBlock.pixelPtr == NULL) {
if (interp != NULL) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
@@ -2782,8 +2796,7 @@ Tk_PhotoPutBlock(
return TCL_ERROR;
}
memToFree = sourceBlock.pixelPtr;
- memcpy(sourceBlock.pixelPtr, blockPtr->pixelPtr, sourceBlock.height
- * sourceBlock.pitch);
+ memcpy(sourceBlock.pixelPtr, blockPtr->pixelPtr, cpyLen);
}
@@ -3205,8 +3218,21 @@ Tk_PhotoPutZoomedBlock(
if (sourceBlock.pixelPtr >= masterPtr->pix32
&& sourceBlock.pixelPtr <= masterPtr->pix32 + masterPtr->width
* masterPtr->height * 4) {
- sourceBlock.pixelPtr = attemptckalloc(sourceBlock.height
- * sourceBlock.pitch);
+ /*
+ * Fix 5c51be6411: avoid reading
+ *
+ * (sourceBlock.pitch - sourceBlock.width * sourceBlock.pixelSize)
+ *
+ * bytes past the end of masterPtr->pix32[] when
+ *
+ * blockPtr->pixelPtr > (masterPtr->pix32 +
+ * 4 * masterPtr->width * masterPtr->height -
+ * sourceBlock.height * sourceBlock.pitch)
+ */
+ unsigned int cpyLen = (sourceBlock.height - 1) * sourceBlock.pitch +
+ sourceBlock.width * sourceBlock.pixelSize;
+
+ sourceBlock.pixelPtr = attemptckalloc(cpyLen);
if (sourceBlock.pixelPtr == NULL) {
if (interp != NULL) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
@@ -3216,8 +3242,7 @@ Tk_PhotoPutZoomedBlock(
return TCL_ERROR;
}
memToFree = sourceBlock.pixelPtr;
- memcpy(sourceBlock.pixelPtr, blockPtr->pixelPtr, sourceBlock.height
- * sourceBlock.pitch);
+ memcpy(sourceBlock.pixelPtr, blockPtr->pixelPtr, cpyLen);
}
xEnd = x + width;
diff --git a/generic/tkInt.h b/generic/tkInt.h
index 3a8328f..22460fb 100644
--- a/generic/tkInt.h
+++ b/generic/tkInt.h
@@ -692,7 +692,7 @@ typedef struct TkWindow {
Visual *visual; /* Visual to use for window. If not default,
* MUST be set before X window is created. */
int depth; /* Number of bits/pixel. */
- Window window; /* X's id for window. NULL means window hasn't
+ Window window; /* X's id for window. None means window hasn't
* actually been created yet, or it's been
* deleted. */
struct TkWindow *childList; /* First in list of child windows, or NULL if
diff --git a/generic/tkListbox.c b/generic/tkListbox.c
index d92325f..514b349 100644
--- a/generic/tkListbox.c
+++ b/generic/tkListbox.c
@@ -3318,7 +3318,7 @@ ListboxUpdateVScrollbar(
/*
* We must hold onto the interpreter from the listPtr because the data at
- * listPtr might be freed as a result of the Tcl_VarEval.
+ * listPtr might be freed as a result of the Tcl_EvalEx.
*/
interp = listPtr->interp;
@@ -3329,7 +3329,7 @@ ListboxUpdateVScrollbar(
Tcl_DStringAppend(&buf, firstStr, -1);
Tcl_DStringAppend(&buf, " ", -1);
Tcl_DStringAppend(&buf, lastStr, -1);
- result = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0);
+ result = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, TCL_EVAL_GLOBAL);
Tcl_DStringFree(&buf);
if (result != TCL_OK) {
Tcl_AddErrorInfo(interp,
@@ -3390,7 +3390,7 @@ ListboxUpdateHScrollbar(
/*
* We must hold onto the interpreter because the data referred to at
- * listPtr might be freed as a result of the call to Tcl_VarEval.
+ * listPtr might be freed as a result of the call to Tcl_EvalEx.
*/
interp = listPtr->interp;
@@ -3401,7 +3401,7 @@ ListboxUpdateHScrollbar(
Tcl_DStringAppend(&buf, firstStr, -1);
Tcl_DStringAppend(&buf, " ", -1);
Tcl_DStringAppend(&buf, lastStr, -1);
- result = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0);
+ result = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, TCL_EVAL_GLOBAL);
Tcl_DStringFree(&buf);
if (result != TCL_OK) {
Tcl_AddErrorInfo(interp,
diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index 318930f..f43bbe0 100644
--- a/generic/tkMenu.c
+++ b/generic/tkMenu.c
@@ -1019,7 +1019,7 @@ TkInvokeMenu(
Tcl_DStringInit(&ds);
Tcl_DStringAppend(&ds, "tk::TearOffMenu ", -1);
Tcl_DStringAppend(&ds, Tk_PathName(menuPtr->tkwin), -1);
- result = Tcl_EvalEx(interp, Tcl_DStringValue(&ds), -1, 0);
+ result = Tcl_EvalEx(interp, Tcl_DStringValue(&ds), -1, TCL_EVAL_GLOBAL);
Tcl_DStringFree(&ds);
} else if ((mePtr->type == CHECK_BUTTON_ENTRY)
&& (mePtr->namePtr != NULL)) {
diff --git a/generic/tkText.c b/generic/tkText.c
index b696647..2ddfea1 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -5039,7 +5039,7 @@ DumpSegment(
Tcl_DStringAppend(&buf, Tcl_GetString(command), -1);
Tcl_DStringAppend(&buf, " ", -1);
Tcl_DStringAppend(&buf, Tcl_GetString(tuple), -1);
- code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0);
+ code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, TCL_EVAL_GLOBAL);
Tcl_DStringFree(&buf);
if (code != TCL_OK) {
Tcl_AddErrorInfo(interp,
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index 2deeaf2..6d680f6 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -1367,7 +1367,7 @@ LayoutDLine(
* expectations in the rest of the code, but we are able to skip
* elided portions of the line quickly.
*
- * If current chunk is elided and last chunk was too, coalese.
+ * If current chunk is elided and last chunk was too, coalesce.
*
* This also means that each logical line which is entirely elided
* still gets laid out into a DLine, but with zero height. This isn't
@@ -5275,7 +5275,7 @@ TkTextRelayoutWindow(
/*
* Invalidate cached scrollbar positions, so that scrollbars sliders will
- * be udpated.
+ * be updated.
*/
dInfoPtr->xScrollFirst = dInfoPtr->xScrollLast = -1;
@@ -6527,7 +6527,7 @@ GetXView(
Tcl_DStringAppend(&buf, textPtr->xScrollCmd, -1);
Tcl_DStringAppend(&buf, buf1, -1);
Tcl_DStringAppend(&buf, buf2, -1);
- code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0);
+ code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, TCL_EVAL_GLOBAL);
Tcl_DStringFree(&buf);
if (code != TCL_OK) {
Tcl_AddErrorInfo(interp,
@@ -6812,7 +6812,7 @@ GetYView(
Tcl_DStringAppend(&buf, textPtr->yScrollCmd, -1);
Tcl_DStringAppend(&buf, buf1, -1);
Tcl_DStringAppend(&buf, buf2, -1);
- code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0);
+ code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, TCL_EVAL_GLOBAL);
Tcl_DStringFree(&buf);
if (code != TCL_OK) {
Tcl_AddErrorInfo(interp,
diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c
index 0d223fe..f7e4294 100644
--- a/generic/tkTextTag.c
+++ b/generic/tkTextTag.c
@@ -1440,7 +1440,7 @@ ChangeTagPriority(
void
TkTextBindProc(
- ClientData clientData, /* Pointer to canvas structure. */
+ ClientData clientData, /* Pointer to text widget structure. */
XEvent *eventPtr) /* Pointer to X event that just happened. */
{
TkText *textPtr = clientData;
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index 121bb5a..8ec18e2 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -3339,7 +3339,7 @@ Initialize(
tcl_findLibrary tk $tk_version $tk_patchLevel tk.tcl TK_LIBRARY tk_library\n\
}\n\
}\n\
-tkInit", -1, 0);
+tkInit", -1, TCL_EVAL_GLOBAL);
}
if (code == TCL_OK) {
/*
diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c
index 29f69a1..770d8ff 100644
--- a/generic/ttk/ttkEntry.c
+++ b/generic/ttk/ttkEntry.c
@@ -557,7 +557,7 @@ static int EntryNeedsValidation(VMODE vmode, VREASON reason)
* Returns:
* TCL_OK if the change is accepted
* TCL_BREAK if the change is rejected
- * TCL_ERROR if any errors occured
+ * TCL_ERROR if any errors occurred
*
* The change will be rejected if -validatecommand returns 0,
* or if -validatecommand or -invalidcommand modifies the value.