Tk Source Code

Artifact [c8b35459]
Login

Artifact c8b354599f93b04b3e8175e83ff0d8c0a7cbe9818a64159e8d7f1b5ceb785181:

Attachment "08.patch" to ticket [25e7db2d] added by 0xjnml 2026-10-04 16:50:23. (unpublished)
--- a/win/tkWinAccessibility.c
+++ b/win/tkWinAccessibility.c
@@ -1098,16 +1098,28 @@
     Tcl_Obj *valObj = Tcl_NewStringObj(buf, -1);
     Tcl_IncrRefCount(valObj);
 
+    int changed = 1;
     if (!newEntry) {
 	/* Replace existing value: free previous Tcl_Obj if present. */
 	Tcl_Obj *old = (Tcl_Obj *)Tcl_GetHashValue(valuePtr);
 	if (old) {
+	    changed = strcmp(Tcl_GetString(old), buf) != 0;
 	    Tcl_DecrRefCount(old);
 	}
     }
     Tcl_SetHashValue(valuePtr, valObj);
     TkGlobalUnlock();
 
+    /*
+     * Notify only a real change. This runs for every check and radio button
+     * whenever the child-ID table is rebuilt, which get_accChild does on
+     * every call; reporting a change each time makes the screen reader call
+     * get_accChild again, a feedback loop.
+     */
+    if (!changed) {
+	return;
+    }
+
     /* Notify MSAA about both value and state changes. */
     {
 	Tk_Window toplevel = GetToplevelOfWidget(win);