Tk Source Code

Changes On Branch bug-8ce672d1a1
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch bug-8ce672d1a1 Excluding Merge-Ins

This is equivalent to a diff from f921d987 to ede12eef

2024-12-03
04:00
Fix [8ce672d1a1]: Segfault with Tk >= 8.6.14 when using menu(button) with the -font option in a certain way. Patch from Christian Werner. check-in: 0b92d7c5 user: fvogel tags: core-8-6-branch
2024-11-25
11:10
Fix [bcbf4c9875]: Tk intialization overwrites thread specific data check-in: df1a487a user: jan.nijtmans tags: core-8-6-branch
2024-11-22
21:37
Let this bugfix branch build and test. Closed-Leaf check-in: ede12eef user: fvogel tags: bug-8ce672d1a1
21:35
Fix [8ce672d1a1]: Segfault with Tk >= 8.6.14 when using menu(button) with the -font option in a certain way. Patch from Christian Werner. check-in: 006481ff user: fvogel tags: bug-8ce672d1a1
2024-11-13
21:36
Merge-mark check-in: a9dcc398 user: jan.nijtmans tags: core-8-branch
21:15
Make a list of the bugs fixed so far check-in: f921d987 user: jan.nijtmans tags: core-8-6-branch
20:41
(cherry-pick) Workaround for [36e379c01b]: macOS Ventura, X11 build with XQuartz: crash in XLoadQueryFont check-in: 5c47c3c2 user: jan.nijtmans tags: core-8-6-branch

Changes to .github/workflows/linux-build.yml.
1
2
3
4
5
6
7

8
9
10
11
12
13
14
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15







+







name: Linux
on:
  push:
    branches:
    - "main"
    - "core-8-branch"
    - "core-8-6-branch"
    - "bug-8ce672d1a1"
    tags:
    - "core-**"
permissions:
  contents: read
defaults:
  run:
    shell: bash
Changes to .github/workflows/mac-build.yml.
1
2
3
4
5
6
7

8
9
10
11
12
13
14
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15







+







name: macOS
on:
  push:
    branches:
    - "main"
    - "core-8-branch"
    - "core-8-6-branch"
    - "bug-8ce672d1a1"
    tags:
    - "core-**"
permissions:
  contents: read
env:
  ERROR_ON_FAILURES: 1
jobs:
Changes to .github/workflows/win-build.yml.
1
2
3
4
5
6
7

8
9
10
11
12
13
14
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15







+







name: Windows
on:
  push:
    branches:
    - "main"
    - "core-8-branch"
    - "core-8-6-branch"
    - "bug-8ce672d1a1"
    tags:
    - "core-**"
permissions:
  contents: read
env:
  ERROR_ON_FAILURES: 1
jobs:
Changes to generic/tkMenu.c.
996
997
998
999
1000
1001
1002

1003
1004
1005
1006
1007
1008
1009
1010
1011











1012

1013
1014
1015
1016
1017
1018
1019
1020
1021
1022

1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034

1035
1036
1037
1038
1039
1040

1041
1042
1043
1044
1045
1046
1047

1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064




1065
1066
1067

1068


1069
1070
1071
1072
1073
1074
1075
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023

1024
1025
1026
1027
1028
1029
1030
1031
1032
1033

1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045

1046
1047
1048
1049
1050
1051

1052
1053
1054
1055
1056
1057
1058

1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072




1073
1074
1075
1076

1077
1078
1079

1080
1081
1082
1083
1084
1085
1086
1087
1088







+









+
+
+
+
+
+
+
+
+
+
+
-
+









-
+











-
+





-
+






-
+













-
-
-
-
+
+
+
+
-


+
-
+
+







				 * Tk Bug [2d3a81c0].
				 */
    int index)			/* The zero based index of the item we are
    				 * invoking. */
{
    int result = TCL_OK;
    TkMenuEntry *mePtr;
    Tcl_Obj *commandPtr = NULL, *namePtr = NULL;

    if (index < 0) {
    	goto done;
    }
    mePtr = menuPtr->entries[index];
    if (mePtr->state == ENTRY_DISABLED) {
	goto done;
    }

    if (mePtr->commandPtr != NULL) {
	commandPtr = mePtr->commandPtr;
	Tcl_IncrRefCount(commandPtr);
    }
    if ((mePtr->type == CHECK_BUTTON_ENTRY) ||
	    (mePtr->type == RADIO_BUTTON_ENTRY)) {
	if (mePtr->namePtr != NULL) {
	    namePtr = mePtr->namePtr;
	    Tcl_IncrRefCount(namePtr);
	}
    }
    Tcl_Preserve(mePtr);

    if (mePtr->type == TEAROFF_ENTRY) {
	Tcl_DString ds;

	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, TCL_EVAL_GLOBAL);
	Tcl_DStringFree(&ds);
    } else if ((mePtr->type == CHECK_BUTTON_ENTRY)
	    && (mePtr->namePtr != NULL)) {
	    && (namePtr != NULL)) {
	Tcl_Obj *valuePtr;

	if (mePtr->entryFlags & ENTRY_SELECTED) {
	    valuePtr = mePtr->offValuePtr;
	} else {
	    valuePtr = mePtr->onValuePtr;
	}
	if (valuePtr == NULL) {
	    valuePtr = Tcl_NewObj();
	}
	Tcl_IncrRefCount(valuePtr);
	if (Tcl_ObjSetVar2(interp, mePtr->namePtr, NULL, valuePtr,
	if (Tcl_ObjSetVar2(interp, namePtr, NULL, valuePtr,
		TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) {
	    result = TCL_ERROR;
	}
	Tcl_DecrRefCount(valuePtr);
    } else if ((mePtr->type == RADIO_BUTTON_ENTRY)
	    && (mePtr->namePtr != NULL)) {
	    && (namePtr != NULL)) {
	Tcl_Obj *valuePtr = mePtr->onValuePtr;

	if (valuePtr == NULL) {
	    valuePtr = Tcl_NewObj();
	}
	Tcl_IncrRefCount(valuePtr);
	if (Tcl_ObjSetVar2(interp, mePtr->namePtr, NULL, valuePtr,
	if (Tcl_ObjSetVar2(interp, namePtr, NULL, valuePtr,
		TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) {
	    result = TCL_ERROR;
	}
	Tcl_DecrRefCount(valuePtr);
    }

    /*
     * We check numEntries in addition to whether the menu entry has a command
     * because that goes to zero if the menu gets deleted (e.g., during
     * command evaluation).
     */

    if ((menuPtr->numEntries != 0) && (result == TCL_OK)
	    && (mePtr->commandPtr != NULL)) {
	Tcl_Obj *commandPtr = mePtr->commandPtr;

	Tcl_IncrRefCount(commandPtr);
	    && (commandPtr != NULL)) {
	result = Tcl_EvalObjEx(interp, commandPtr, TCL_EVAL_GLOBAL);
    }
    if (commandPtr != NULL) {
	result = Tcl_EvalObjEx(interp, commandPtr, TCL_EVAL_GLOBAL);
	Tcl_DecrRefCount(commandPtr);
    }
    if (namePtr != NULL) {
    Tcl_Release(mePtr);
	Tcl_DecrRefCount(namePtr);
    }

  done:
    return result;
}

/*
 *----------------------------------------------------------------------