Tk Source Code

Artifact [ff7b3775]
Login

Artifact ff7b377514d1254511e9db60d5ea4591fa016809612b78be86d88ff6572f02ad:

Attachment "tk-2.patch" to ticket [e5ccf542] added by erikleunissen 2020-12-23 21:08:36.
diff -ur tk.old/generic/tkWindow.c tk.new/generic/tkWindow.c
--- tk.old/generic/tkWindow.c	2019-09-25 16:59:38.000000000 +0200
+++ tk.new/generic/tkWindow.c	2020-12-23 21:28:20.000000000 +0100
@@ -3259,6 +3259,20 @@
     if (code != TCL_OK) {
 	goto done;
     }
+    
+	/*
+	 * When assigning the widget class as a binding tag, override the application
+	 * name which was assigned to the widget class of the root window. Instead,
+	 * use the generic widget class "Toplevel" as all toplevel do.
+	 */
+	cmd = Tcl_NewStringObj("bindtags . [lreplace [bindtags .] 1 1 Toplevel]", -1);
+	Tcl_IncrRefCount(cmd);
+	code = Tcl_EvalObjEx(interp, cmd, 0);
+	Tcl_DecrRefCount(cmd);
+	if (code != TCL_OK) {
+	    goto done;
+	}
+    
     Tcl_ResetResult(interp);
     if (sync) {
 	(void)XSynchronize(Tk_Display(Tk_MainWindow(interp)), True);
Only in tk.new/generic: tkWindow.c~