Tk Source Code

Changes On Branch bug-310c74ecf4
Login

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

Changes In Branch bug-310c74ecf4 Excluding Merge-Ins

This is equivalent to a diff from 85b486a9 to fadca8dc

2023-05-03
20:28
Fix [310c74ecf4]: ThemeChangedProc() can be called after Tk destroyed. check-in: b1876b9e user: fvogel tags: core-8-6-branch
2023-05-02
20:21
Remove superfluous casts. Closed-Leaf check-in: fadca8dc user: fvogel tags: bug-310c74ecf4
2023-05-01
14:22
Alternate fix for [310c74ecf4], not making use of a delete trace. check-in: 67ac1ac1 user: fvogel tags: bug-310c74ecf4
2023-04-16
19:56
Fix [0c734dde2a]: Xlib.h: avoid -Wstrict-prototypes warnings check-in: 80e5be23 user: jan.nijtmans tags: core-8-6-branch
2023-04-15
12:11
Fix [310c74ecf4]: ThemeChangedProc() can be called after Tk destroyed. Patch from CHristopher Chavez. check-in: fcbbbaa3 user: fvogel tags: bug-310c74ecf4
2023-04-14
23:59
Fix [0c734dde2a]: Xlib.h: avoid -Wstrict-prototypes warnings check-in: ebb1888e user: jan.nijtmans tags: bug-0c734dde2a
2023-04-10
19:31
Fix [f4d9d74df6]: ignored -disabledwidth for canvas rectangle and oval items. Patch from Christopher Chavez. check-in: 7f869255 user: fvogel tags: trunk, main
19:31
Fix [f4d9d74df6]: ignored -disabledwidth for canvas rectangle and oval items. Patch from Christopher Chavez. check-in: 85b486a9 user: fvogel tags: core-8-6-branch
2023-03-30
09:33
Fix [15c685a976]: Issues with menu cloning. check-in: af772820 user: sbron tags: core-8-6-branch

Changes to generic/tkInt.h.
1088
1089
1090
1091
1092
1093
1094
1095

1096
1097
1098

1099
1100
1101
1102
1103
1104
1105
1088
1089
1090
1091
1092
1093
1094

1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106







-
+



+







#include "tkIntDecls.h"

#ifdef __cplusplus
extern "C" {
#endif

/*
 * Themed widget set init function:
 * Themed widget set init function, and handler called when Tk is destroyed.
 */

MODULE_SCOPE int	Ttk_Init(Tcl_Interp *interp);
MODULE_SCOPE void	Ttk_TkDestroyedHandler(Tcl_Interp *interp);

/*
 * Internal functions shared among Tk modules but not exported to the outside
 * world:
 */

MODULE_SCOPE int	Tk_BellObjCmd(ClientData clientData,
Changes to generic/tkWindow.c.
1617
1618
1619
1620
1621
1622
1623

1624
1625
1626
1627
1628
1629
1630
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631







+







	    Tcl_DeleteHashTable(&winPtr->mainPtr->busyTable);
	    Tcl_DeleteHashTable(&winPtr->mainPtr->nameTable);
	    TkBindFree(winPtr->mainPtr);
	    TkDeleteAllImages(winPtr->mainPtr);
	    TkFontPkgFree(winPtr->mainPtr);
	    TkFocusFree(winPtr->mainPtr);
	    TkStylePkgFree(winPtr->mainPtr);
	    Ttk_TkDestroyedHandler(winPtr->mainPtr->interp);

	    /*
	     * When embedding Tk into other applications, make sure that all
	     * destroy events reach the server. Otherwise the embedding
	     * application may also attempt to destroy the windows, resulting
	     * in an X error
	     */
Changes to generic/ttk/ttkTheme.c.
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
399
400
401
402
403
404
405


406
407
408
409
410
411
412
413
414
415
416
417







418
419
420
421
422
423
424







-
-












-
-
-
-
-
-
-







    Theme *defaultTheme;		/* Default theme; global fallback*/
    Theme *currentTheme;		/* Currently-selected theme */
    Cleanup *cleanupList;		/* Cleanup records */
    Ttk_ResourceCache cache;		/* Resource cache */
    int themeChangePending;		/* scheduled ThemeChangedProc call? */
} StylePackageData;

static void ThemeChangedProc(void *);	/* Forward */

/* Ttk_StylePkgFree --
 *	Cleanup procedure for StylePackageData.
 */
static void Ttk_StylePkgFree(
    ClientData clientData,
    TCL_UNUSED(Tcl_Interp *))
{
    StylePackageData *pkgPtr = (StylePackageData *)clientData;
    Tcl_HashSearch search;
    Tcl_HashEntry *entryPtr;
    Cleanup *cleanup;

    /*
     * Cancel any pending ThemeChanged calls:
     */
    if (pkgPtr->themeChangePending) {
	Tcl_CancelIdleCall(ThemeChangedProc, pkgPtr);
    }

    /*
     * Free themes.
     */
    entryPtr = Tcl_FirstHashEntry(&pkgPtr->themeTable, &search);
    while (entryPtr != NULL) {
	Theme *themePtr = (Theme *)Tcl_GetHashValue(entryPtr);
	FreeTheme(themePtr);
482
483
484
485
486
487
488
489

490
491
492
493
494
495
496
473
474
475
476
477
478
479

480
481
482
483
484
485
486
487







-
+







 *	function is called with the current Tcl interpreter and the client
 *	data provided here.
 *
 */
void Ttk_RegisterCleanup(
    Tcl_Interp *interp, ClientData clientData, Ttk_CleanupProc *cleanupProc)
{
    StylePackageData *pkgPtr = (StylePackageData *)GetStylePackageData(interp);
    StylePackageData *pkgPtr = GetStylePackageData(interp);
    Cleanup *cleanup = (Cleanup *)ckalloc(sizeof(*cleanup));

    cleanup->clientData = clientData;
    cleanup->cleanupProc = cleanupProc;
    cleanup->next = pkgPtr->cleanupList;
    pkgPtr->cleanupList = cleanup;
}
526
527
528
529
530
531
532



















533
534
535
536
537
538
539
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







static void ThemeChanged(StylePackageData *pkgPtr)
{
    if (!pkgPtr->themeChangePending) {
	Tcl_DoWhenIdle(ThemeChangedProc, pkgPtr);
	pkgPtr->themeChangePending = 1;
    }
}

/* Ttk_TkDestroyedHandler --
 *	See bug [310c74ecf440]: idle calls to ThemeChangedProc()
 *	need to be canceled when Tk is destroyed, since the interp
 *	may still be active afterward; canceling them from
 *	Ttk_StylePkgFree() would be too late.
 */
void Ttk_TkDestroyedHandler(
    Tcl_Interp* interp)
{
    StylePackageData* pkgPtr = GetStylePackageData(interp);

    /*
     * Cancel any pending ThemeChanged calls:
     */
    if (pkgPtr->themeChangePending) {
	Tcl_CancelIdleCall(ThemeChangedProc, pkgPtr);
    }
}

/*
 * Ttk_CreateTheme --
 *	Create a new theme and register it in the global theme table.
 *
 * Returns:
 * 	Pointer to new Theme structure; NULL if named theme already exists.