Tk Source Code

Timeline
Login

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

10 check-ins related to "x11-appearance"

2026-11-15
20:22
Merge x11-appearance, where the appearance now writes its palette below the priority a user's X resources have, so that the colours the user chose are kept; the palette the desktop asks for goes at that priority too.

Two sets of test numbers had to be settled. Both sides had added tk-9.x, so trunk's [tk fileicon] tests keep those numbers and [tk appearance] moves to tk-10.x. And the branch still carried a second copy of palette-1.1 and 1.2 numbered 6.1 and 6.2, from before the duplicates were merged away on x11-appearance, where those numbers now belong to other tests; it is gone. check-in: 66e2c4ba user: serhiy.storchaka tags: x11-desktop-appearance

19:59
Keep the colours the user asked for when the appearance changes. A palette written by [wm attributes $w -appearance] used to outrank the colours a user chose in X resources, which is not how the other platforms behave: there the option database is consulted before a window falls back on anything the appearance would give it, so an entry of the user's is simply never reached. Measured on Windows, [wm attributes . -appearance dark] darkens the window while every colour the database answers for stays as it was, before and after. The appearance now writes its palette below the priority those colours have, and one palette follows another, all of them being written at the one priority. Two things were needed for that. tk_setPalette takes -priority, which it gives to the entries it leaves in the database: it defaults to userDefault, where its entries have always gone, so nothing changes for anyone who does not ask. And ::tk::RecolorTree now asks who owns the colour a window wears rather than only what it is: where the entry which governs it was added above the priority the palette is written at, the window is left alone, both the window itself and the entry which would reach the windows made later. Without that the two halves disagreed, the windows made before a change going one way and those made after it the other, because a priority governs what is written to the database but not a [configure]. Asking that question needs the database to answer it, so [option priority window name class] returns the priority of the entry [option get] would answer with, or nothing where none matches and the window falls back on a default of its own. leaf check-in: 77a98afc user: serhiy.storchaka tags: x11-appearance
19:50
Merge main, which now has the palette completion of [807b2f8916]: the branch no longer rests on ttk-derive-missing-colors, whose leaf is closed. check-in: 5c83407b user: serhiy.storchaka tags: x11-appearance
14:57
Prepare tkCanvas.c for anti-aliasing (backported from Wayland branch) check-in: 93dd6ad1 user: jan.nijtmans tags: trunk, main
2026-11-02
22:57
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: 7897cd67 user: serhiy.storchaka tags: x11-desktop-appearance
20:00
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. check-in: da72c23c user: serhiy.storchaka tags: x11-appearance
17:30
Fix for [3f5867c997]: Inconsistency between grid info, place info and pack info check-in: ebe87fbf user: csaba tags: trunk, main
2026-10-26
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. closed check-in: 76acab2c user: serhiy.storchaka tags: x11-appearance
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. closed check-in: d0c3cb85 user: serhiy.storchaka tags: ttk-derive-missing-colors