Tk Source Code

Timeline
Login

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

50 most recent check-ins

2026-10-26
21:53
Clean up changes that broke Thai/Lao rendering leaf check-in: 60cb9a8b user: kevin_walzer tags: wayland
21:44
Fix [2e3d6cdae4]: on X11 a posted menu stayed open on top of another window when the application lost the focus, and stayed in place when its toplevel was moved, which the compositor of a Wayland session allows in spite of the grab. The toplevel which posted the menus is now watched with the TkMenuWatch binding tag, and the menus are unposted when it is moved or when the application loses the focus. A torn-off menu stays, only the cascades posted from it are unposted. New tests menu-49.1 to 49.6. leaf check-in: 572cc8c4 user: serhiy.storchaka tags: menu-unpost-focus-move
21:34
Leave the appearance the application chose alone. Following the desktop was moved to the first idle so that no window is made while Tk is still initialising, but an application which sets [wm attributes . -appearance] while it starts up then had its choice undone a moment later, the deferred call applying the desktop's scheme over it. It now applies the desktop's scheme only where the appearance is still the one it was given, which is the condition the change handler already uses. leaf check-in: 6c5d2af7 user: serhiy.storchaka tags: x11-desktop-appearance
21:19
Fix [346407]: Missing error-handling when MenuNewEntry() returns NULL leaf check-in: 7fef988d user: jan.nijtmans tags: core-9-0-branch
21:14
Follow the appearance the desktop asks for, as TIP 767 proposes. The colour scheme, the accent colour, the contrast and the reduced-motion preference are read from the org.freedesktop.appearance namespace of the XDG desktop portal, through the D-Bus client of the x11-desktop-portal branch, which is merged here: [::tk::portal::_watch] is added to it for the SettingChanged signal, which arrives while messages are dispatched and so is handed to the script by way of an idle handler rather than run there. [tk appearance] reports the settings and changes nothing, every one of them answered for whether the portal answers or not. The "auto" value of [wm attributes -appearance] now follows the scheme, the desktop's accent becoming the selection colour, while a colour the user chose in X resources outranks both, the database being read before Tk writes a palette of its own. The events of TIP 750 are sent when the desktop changes its mind, whatever the attribute's value, and the palette follows where it is "auto". The appearance is applied once the application is up rather than while Tk is still initialising: applying a palette makes a window of its own, and making one during initialisation leaves the selection tests failing, a different one each time. Where no session bus is named none is started to look for one, a toolkit having no business launching a bus while it starts up. Also merged: the fix of [1c51656171], without which a palette which is switched back and forth leaves the windows made before and after a switch disagreeing. check-in: a85527b5 user: serhiy.storchaka tags: x11-desktop-appearance
21:10
Fix [346407]: Missing error-handling when MenuNewEntry() returns NULL leaf check-in: 1512c574 user: jan.nijtmans tags: trunk, main
20:09
Fine-tune systray testing on Wayland check-in: 98628b40 user: kevin_walzer tags: wayland
20:01
Fix [c70fe74bc4]: when no window can become key, install the menubar of the main window, so that an application which only shows the menubar of "." keeps it after closing its last toplevel, and when it is activated again. Tests menu-48.4 and 48.5. leaf check-in: 193a1d10 user: nab tags: nab-aqua-menubar-owner
19:59
Remove systray.test from testing on Wayland - not universally supported on compositors and cannot run in headless environment on Github check-in: ee4e6840 user: kevin_walzer tags: wayland
19:49
Minor font adjustments check-in: ac4f2153 user: kevin_walzer tags: wayland
19:47
Fix for [1391053fff]: Win32 nonclient double-click causes spurious Button-1 in app leaf check-in: 0b557a2d user: csaba tags: core-8-6-branch
19:08
Fix for [1391053fff]: Win32 nonclient double-click causes spurious Button-1 in app check-in: dda7e89d user: csaba tags: core-9-0-branch
19:08
Fix for [1c51656171]: add the tests for tk_setPalette, left out of [255fe59706] because a new file is not committed until it is added. leaf check-in: e64ae55c user: serhiy.storchaka tags: tk-setpalette-recolor
19:08
Fix for [1c51656171]: recolour only the windows which still have the colour Tk gave them. tk_setPalette is documented to modify "all of the color options for existing windows that have the default value", and until [2e0526a2d3] (2024-07-07) ::tk::RecolorTree did that: it compared the colour a window had with the default one, and where they agreed it both recoloured the window and recorded the new colour in the option database for the windows made later. That commit moved the configure out of the condition, so that every window is recoloured whether or not the application had given it a colour of its own, and negated the condition, so that the option database is written in the opposite case. Its new comment reads [lindex $value 4] as the colour being requested, but at that point it is still the colour the window has. Two things follow, neither of them in 8.6: a window the application coloured itself loses that colour, and a third palette no longer reaches the windows made after it, because the entry of class priority keeps the colour of the palette before it while *background at widgetDefault holds the new one. So a palette which can be switched back and forth, as a light and a dark one are, leaves the windows made before and after a switch disagreeing. The condition goes back to what it was, and the value it tests is named for what it holds. The tests are new, there having been none for tk_setPalette. check-in: 255fe597 user: serhiy.storchaka tags: tk-setpalette-recolor
18:35
Fix [600313]: the icon list of the file dialog no longer clears the selection when it loses focus check-in: b2ea87aa user: oehhar tags: core-9-0-branch
18:30
Merge x11-desktop-portal, whose D-Bus layer the implementation of TIP 767 builds on: [::tk::portal::_call] for reading org.freedesktop.portal.Settings, and the connection's place in the event loop for SettingChanged. check-in: 9a9f1f72 user: serhiy.storchaka tags: x11-desktop-appearance
18:18
Implement [wm attributes $w -appearance] and [winfo isdark] on X11, as TIP 766 proposes. TIP 750 left both out here: the attribute was rejected as a bad attribute, and the command always returned false, because X11 gives a window no appearance of its own. What a window does have is the colour it is painted, and that colour can already be dark: a desktop or a user who wants dark applications says so in the X resource database, which Tk has always obeyed. So [winfo isdark] now reports whether the window's background is a dark colour, by the weighting tk_setPalette uses to choose between a black and a white foreground, and answers from the attributes Tk records rather than realizing the window. The attribute applies a palette: light and dark are tk_setPalette's, over the background Tk has always had and a dark counterpart, and auto is the palette which was in effect before the attribute was first set, remembered for the purpose and restored exactly, including the colours Tk has compiled in rather than computed. Only the colours which go with the background change. The selection colours are supplied rather than computed from it: an accent goes with a light frame and a dark one alike, and the classic widgets and the themed ones have each had their own, which tk_setPalette on its own would replace with a shade of the background six units from the frame. Because the option database has no per-window scope, the palette is the application's and not the window's, which the tests state on both sides. seedColors takes the colours its caller imposes as an argument, so that the rules which follow the selection keep one home. Three tests of the attribute which were portable but lived in the Windows-only file move to wm.test, the duplicate of the usage test goes, and the check that [winfo isdark] follows the attribute loses the constraint which kept it off X11. leaf check-in: 76acab2c user: serhiy.storchaka tags: x11-appearance
17:46
Fix [c70fe74bc4]: on Aqua, Tk_SetMainMenubar installed the menu of any window, so -menu on a withdrawn toplevel replaced the menubar of the key window, and destroying a toplevel with -menu showed the default menubar. Only the key window, or the one that becomes key when it is destroyed, now sets the menubar, which is installed as soon as a window becomes key. Tests menu-48.1 to 48.3. check-in: c546e073 user: nab tags: nab-aqua-menubar-owner
17:41
Fix spacing issue in mixed emoji text check-in: bacdb2d6 user: kevin_walzer tags: trunk, main
17:15
Improved shaping with bidi text check-in: c9daf640 user: kevin_walzer tags: wayland
16:14
Add missing casts to NULL sentinels check-in: bfc62168 user: chrstphrchvz tags: core-8-6-branch
16:12
Add missing casts to NULL sentinels closed check-in: f67b7500 user: chrstphrchvz tags: sentinels-c86b
16:00
Also disable animation when forcing window initialization - thanks to Nicolas Bats leaf check-in: 4d57a612 user: culler tags: tip_765
15:39
Fix [cc736f8692]: Ctrl+Left in text skips a one-character word before the cursor. Rebase to trunk leaf check-in: 17bb1336 user: jan.nijtmans tags: text-prev-word-one-char, core-text-prev-word-one-char
15:05
Simplify the fix for [cc736f8692], now that Tcl ticket 3e7c4a039d is fixed in Tcl: TextPrevPos gets an optional index argument, and TextPrevWord passes "end+1", the cursor position, instead of appending a space. Fix the ICU ::tk::startOfPreviousWord, which returned the position of a space when only spaces preceded the start (e.g. 0 for "\n" 1, 1 for "a \n" 3); it now gives the same results as tcl_startOfPreviousWord. New tests cluster-4.10..4.14. check-in: 2bcf1dec user: serhiy.storchaka tags: text-prev-word-one-char
14:45
Fix for [1391053fff]: Win32 nonclient double-click causes spurious Button-1 in app check-in: b3616e16 user: csaba tags: trunk, main
14:19
Merge trunk check-in: 07f47570 user: kevin_walzer tags: wayland
14:19
Improvements in complex bidi shaping check-in: 2ebdaa01 user: kevin_walzer tags: trunk, main
13:14
Add missing casts to NULL sentinels check-in: 3f736733 user: chrstphrchvz tags: trunk, main
13:08
tkMacOSXSend.c: add missing cast to NULL sentinel check-in: dafb859c user: chrstphrchvz tags: trunk, main
12:44
Fix for [042da6013e]: give the demos colours which go with their background.

The pendulum demo gives its canvases a white background but leaves the text items at the default foreground, which under a dark appearance is white, so the caption and the axis labels could not be seen. Give those items a fill of their own, as the other demos were given one.

The widget demo colours its index links for a light background, which the text widget need not have: a #303080 link on a dark one cannot be read. Choose the set which goes with the background the text widget actually has, by the weighting tk_setPalette uses to decide between a black and a white foreground. leaf check-in: 72d8eb47 user: serhiy.storchaka tags: demo-colors-dark-mode

12:31
Fix for [807b2f8916]: compute the colours of the default ttk theme which no X resource supplies.

A desktop which translates its theme into X resources generally sets only background and foreground, which reach three of the theme's thirteen colours. The rest kept values chosen for a light grey palette, so a dark background was left beside a near-white -activebg and a light -darker: the text of a hovered button became illegible.

Compute them instead from the colours the option database does answer for, by the rules tk_setPalette applies to the classic widgets, so that the two agree. The selection colour is not computed: it is an accent rather than a shade of the frame.

Four of those rules are factored into ::tk::ContrastColor, ::tk::Lighten, ::tk::BlendColors and the existing ::tk::Darken, which tk_setPalette now calls instead of writing them out; its output is unchanged. ::tk::Darken scaled a component down to eight bits before applying the percentage, losing up to a unit, and now divides once. leaf check-in: d0c3cb85 user: serhiy.storchaka tags: ttk-derive-missing-colors

11:44
Add additional Xlib function definitions check-in: 7af87e04 user: kevin_walzer tags: wayland
11:15
Add missing casts to NULL sentinels check-in: 0cafd571 user: chrstphrchvz tags: sentinels-c86b
10:30
Add missing casts to NULL sentinels check-in: 19a6052e user: chrstphrchvz tags: core-9-0-branch
10:22
tkMacOSXSend.c: add missing cast to NULL sentinel closed check-in: 7b25720e user: chrstphrchvz tags: mac-send-sentinel-cast
10:17
Make everythihg compile with -DTK_NO_DEPRECATED check-in: b9967113 user: jan.nijtmans tags: wayland
2026-10-25
23:18
- more fixes to the .TH line of attribtable.n - unify attribtable.n, busy.n - initial conversions of 7 manual pages leaf check-in: d4a71319 user: Torsten tags: tip-700
22:50
also a malformed .TH line in attribtable.n now corrected check-in: e5973f90 user: Torsten tags: tip-700
22:35
Move misplaced bracket check-in: 6fd451d2 user: culler tags: tip_765
22:18
corrected malformed .TH line for accessible.n, fileicon.n, print.n, sysnotify.n, systray.n check-in: f8a379d1 user: Torsten tags: tip-700
21:04
Fix segfault in pointer handling. Thanks to Nicolas Bats. check-in: d1c2c94e user: culler tags: tip_765
20:54
Set required GLFW version at 3.4 or greater check-in: 62038001 user: kevin_walzer tags: wayland
20:50
Merge trunk check-in: c92f6d49 user: kevin_walzer tags: wayland
20:32
Fix for [fde9dc2392]: X error BadDrawable when using ttk::style element create with multiple displays check-in: 5ace0365 user: csaba tags: core-8-6-branch
20:12
Fix for [fde9dc2392]: X error BadDrawable when using ttk::style element create with multiple displays check-in: 07e021e2 user: csaba tags: core-9-0-branch
12:42
Fix for [fde9dc2392]: X error BadDrawable when using ttk::style element create with multiple displays check-in: 85428671 user: csaba tags: trunk, main
11:44
Fix for [220931ffff]: option get command responding to invalid input check-in: 5e360f9f user: csaba tags: core-8-6-branch
11:39
Fix for [220931ffff]: option get command responding to invalid input check-in: b9ea3c8a user: csaba tags: core-9-0-branch
11:35
Fix for [220931ffff]: option get command responding to invalid input check-in: 0a7003b0 user: csaba tags: trunk, main