Tk Source Code

Timeline
Login

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

50 most recent check-ins related to "main"

2026-09-20
17:57
Fixes for [e7f4db8bc6] and [07c7c83853] leaf check-in: 98c19a0c user: kevin_walzer tags: trunk, main
17:52
Fix [9e89324a0a]: spinbox parses its value with sscanf("%lf"), which depends on the LC_NUMERIC locale

With a decimal comma "0.5" was read as 0, so the up button gave 0.1 instead of 0.6 and -from/-to clamped valid values. Use Tcl_GetDouble() instead, as for the -from, -to and -increment options. Same for the value reported to AT-SPI. leaf check-in: a13d8dba user: serhiy.storchaka tags: spinbox-locale-parse, core-spinbox-locale-parse

07:34
Fix [90f5cd3f21]: Windows ConfigureNotify uses stale WINDOWPOS x/y when SWP_NOMOVE is set

When SWP_NOMOVE or SWP_NOSIZE is set, use the actual position and size of the window instead of the stale values in WINDOWPOS. leaf check-in: 070b6385 user: serhiy.storchaka tags: win-configure-nomove, core-win-configure-nomove

2026-09-19
20:33
Fix [22172f3732]: "raise" command fails on recent linux

Also send the EWMH _NET_RESTACK_WINDOW request, which KWin and Mutter honor for a window which is not active, while they ignore the plain XReconfigureWMWindow request. It restacks without activating the window. leaf check-in: 75327235 user: serhiy.storchaka tags: x11-raise-ewmh, core-x11-raise-ewmh

17:40
Fix [3de1b72157]: ttk::notebook takes the focus when clicked, even with the -takefocus 0 option

Made the notebook behave like the themed buttons: with -takefocus 0 (or a command returning 0) clicking a tab no longer takes the focus away from another widget; the focus still leaves a deselected tab. leaf check-in: cde76e63 user: serhiy.storchaka tags: ttk-notebook-takefocus-click, core-ttk-notebook-takefocus-click

17:27
Fix [2814003]: tk_messageBox unresponsive on global grab

When the message box is opened from a mouse click, the button release restores the mouse capture of the global grab window just before the command runs, and the native dialog gets no mouse input. Release the capture while a native modal dialog (message box, file, color and font dialogs) is displayed and restore it afterwards. leaf check-in: a99e8306 user: serhiy.storchaka tags: win-dialog-release-capture, core-win-dialog-release-capture

16:40
Fix [220892]: focus changes forgotten during grab

Focus events for windows excluded by a grab are ignored on purpose, so that key events keep going to the grab window, but the focus change was then lost when the grab ended. Now the toplevel which received the focus during the grab gets it when the grab is released. leaf check-in: 083154ff user: serhiy.storchaka tags: focus-after-grab, core-focus-after-grab

16:25
Fix [704212]: [focus] dumps core with certain extensions

Use the top of hierarchy window itself when it has no wrapper (a window created by an extension), instead of passing NULL to TkpChangeFocus(). leaf check-in: 65b5b1ae user: serhiy.storchaka tags: focus-no-wrapper, core-focus-no-wrapper

15:00
Fix [564897]: application doesn't activate

A non-Tk toplevel into which the Tk window has been reparented is now activated on a mouse click, instead of answering MA_NOACTIVATE. leaf check-in: 8089b446 user: serhiy.storchaka tags: win-mouseactivate-foreign-toplevel, core-win-mouseactivate-foreign-toplevel

14:25
Fix [b086bb1d61]: ttk::style command moves ttk::panedwindow sashes

A pane in a hidden notebook tab is unmapped, so its geometry request was taken as the initial request of a pane not shown yet, overwriting the sash position. Use the manager's knowledge whether the pane has been placed. leaf check-in: 880f8c8d user: serhiy.storchaka tags: ttk-paned-hidden-request, core-ttk-paned-hidden-request

12:59
Fix [a4fa3ad2d6]: event misbehavior with certain widgets when embedding

After the embedded application claimed the focus, the window manager set the X focus back to the container's toplevel, and Tk ignored that FocusIn (NotifyInferior), so key events went to the container until a Leave/Enter cycle. Pass the X focus on to the embedded application again. leaf check-in: eb2b41d5 user: serhiy.storchaka tags: x11-embed-focus-return, core-x11-embed-focus-return

11:45
Fix [1692755]: Focused button widgets invoked on Alt-Space

Bind <Alt-space> to nothing for buttons, checkbuttons, radiobuttons and their ttk counterparts, so that Alt-space only opens the window menu on Windows. leaf check-in: 3f81dcc5 user: serhiy.storchaka tags: alt-space-no-invoke, core-alt-space-no-invoke

11:39
Fix [a53a902ac6]: overrideredirect on linux/mac prevents certain binds from working

The window manager never gives the focus to an override-redirect window, and Tk refused to set the X focus to it even with "focus -force" (an old olvwm workaround for menus), so "focus" reported the window while key events went elsewhere. "focus -force" now works for such windows on X11. leaf check-in: 98ea86d9 user: serhiy.storchaka tags: x11-override-redirect-focus

11:08
Implement [3607787]: Expand [event info] to show which event(s) have a keysym

"event info <sequence>" returns the list of virtual events that the physical event sequence is added to. leaf check-in: ec5eb713 user: serhiy.storchaka tags: event-info-sequence

11:01
Fix [9474bd2705]: macOS: Pressing <Tab> in wish console for command completion loses keyboard input

<Tab> is also <<NextWindow>> for the "all" tag, so after the expansion the focus was moved to the next focusable widget: on aqua the console scrollbar, which has key bindings. leaf check-in: bcea1c19 user: serhiy.storchaka tags: console-tab-focus, core-console-tab-focus

10:35
Fix [d41b4dc3a6]: Windows: last cluster of a drawn range loses its trailing glyphs

Tk_DrawCharsInContext() drew only the first glyph of the last cluster in the requested character range, so combining marks at the end of a range (or of a Uniscribe item) were not drawn, e.g. q+U+0308 as q, Devanagari "di" as "da". Extend the glyph range to the first glyph of the next cluster in logical order, taking into account that logClust points at the highest glyph of a cluster in RTL runs. leaf check-in: 34fbe710 user: serhiy.storchaka tags: win-draw-last-cluster-glyphs, core-win-draw-last-cluster-glyphs

10:03
Fix [3295436]: console doesn't handle <<PasteSelection>>

The middle-click paste inherited from the text widget inserted the selection at the pointer position. Now it pastes the PRIMARY selection on the input line like <<Paste>>. leaf check-in: 6de398af user: serhiy.storchaka tags: console-paste-selection, core-console-paste-selection

09:50
[1457279]: Document the bindings which Tk creates for the all tag on Windows to pass Alt keys to Windows, and that replacing them disables that leaf check-in: 2c1f1cbe user: serhiy.storchaka tags: doc-all-tag-bindings
09:41
Fix [2128087]: menubutton menu-traversal shortkeys don't work on Windows

The <Alt-Key> traversal binding was only on the Menubutton class, so Alt+x posted a menubutton only when a menubutton had the focus. Now it is on all windows as on X11, while a native menubar is left to Windows. check-in: e8873433 user: serhiy.storchaka tags: win-alt-key-menubutton, core-win-alt-key-menubutton

09:20
Fix [481308]: Keypad keys report the wrong keysym with Num Lock on X11

With input methods disabled, TkpGetKeySym() ignored Num Lock and reported KP_Left for keypad 4. Select the keypad keysym with Num Lock as XLookupString() does. leaf check-in: 27ce67ba user: serhiy.storchaka tags: x11-keypad-numlock, core-x11-keypad-numlock

09:12
Fix [1151700]: XIM input box font size hard coded

The font set for the preedit area of an over-the-spot input method is now chosen by the pixel size of the widget's line height, reported by Tk_SetCaretPos(), and cached per display. Also do not create the default font set again when the input method is reopened. leaf check-in: c125ceaa user: serhiy.storchaka tags: x11-xim-preedit-font, core-x11-xim-preedit-font

08:19
Fix [d3b9644729]: X11 <KeyRelease> broken

The X server sends a KeyRelease/KeyPress pair for each auto-repeat unless the client enables detectable auto-repeat. Now a held key generates repeated KeyPress events and a single KeyRelease, as on Windows and macOS. leaf check-in: 6d0c31fd user: serhiy.storchaka tags: x11-detectable-autorepeat, core-x11-detectable-autorepeat

2026-09-18
21:38
Fix [ad9a023e45]: Applying canvas move command to objects leaves trails

The coordinates were rounded differently for drawing and for the bounding box, so an item with a negative coordinate with fraction .5 was drawn one pixel outside its bounding box. leaf check-in: 92b3bc65 user: serhiy.storchaka tags: canvas-negative-coords-rounding, core-canvas-negative-coords-rounding

21:28
[da5eab5020]: Document that a pane or tab which is not a child of the container must be higher in the stacking order, as the pack and grid manuals do leaf check-in: dd9b57fc user: serhiy.storchaka tags: doc-container-stacking-order
21:25
Fix [99bb36df86]: Slider trough click repeats if command creates modal dialogue

With a grab set by the modal dialog while the button is down, the button release goes to the grab window and never cancels the repeat. Stop repeating while another window has the grab. leaf check-in: c8f931cb user: serhiy.storchaka tags: scale-repeat-grab, core-scale-repeat-grab

21:01
Fix [13aabdb3c1]: Click to the right of the end of a line moves the insert cursor to the next line

The bbox of a newline extends to the right edge of the widget, and tk::TextClosestGap chose the gap after it, which is on the next line. leaf check-in: 7408a3e7 user: serhiy.storchaka tags: text-click-past-line-end, core-text-click-past-line-end

20:49
Fix [4c595d4d78], [80213d1b1c]: Quadratic time in the text widget with many elided lines

An entirely elided line is laid out as its own zero-height display line, but TkTextFindDisplayLineEnd() walks back over all preceding elided lines and lays them out again, and MeasureUp() (for "see") and TkTextUpdateOneLine() (line metrics) call it for every such line. Skip entirely elided lines there. leaf check-in: 24ac48f5 user: serhiy.storchaka tags: text-elided-lines-quadratic, core-text-elided-lines-quadratic

19:52
Fix [7d8d10e4a9]: Tk console extremely slow before first display

The text widget in an unmapped toplevel has size 1x1, and laying out the text in such a small area is very expensive: a display line per character. Use the requested size instead. leaf check-in: fc8c4f12 user: serhiy.storchaka tags: text-unmapped-layout-size, core-text-unmapped-layout-size

19:39
merge release check-in: 8a1f6836 user: dgp tags: trunk, main
19:09
Fix [fcb1398aa2]: Cascade in a multi-column menu is posted at the right edge of the whole menu instead of its column leaf check-in: 50bd3b58 user: serhiy.storchaka tags: menu-cascade-column-position, core-menu-cascade-column-position
19:02
Fix [adb71ed70b], [df09b0665c]: Widgets cannot get the focus after a modal dialog on Windows

If the parent toplevel is mapped while the dialog is open, its window is reparented into the new wrapper while disabled by the dialog. On close the dialog re-enables and activates the wrapper, and the focus stays on the wrapper. Move the focus to the re-enabled window. leaf check-in: d8d65f66 user: serhiy.storchaka tags: win-dialog-restore-focus, core-win-dialog-restore-focus

18:40
Fix [2effa4b316]: Main window is not activated on startup on Windows

The withdrawn console toplevel is mapped before the main window, and the first-window activation in UpdateWrapper() was wasted on its hidden wrapper. Skip withdrawn and iconic windows. leaf check-in: ab44b598 user: serhiy.storchaka tags: win-activate-first-visible-window, core-win-activate-first-visible-window

17:09
Fix [3131699cb4]: Mapped/Unmapped and Iconic State Problems

Some window managers (Mutter) keep a minimized window mapped and only set _NET_WM_STATE_HIDDEN. Now "wm state" reports "iconic" for such a window, and "wm deiconify" sends a _NET_ACTIVE_WINDOW request to unminimize it. leaf check-in: 144bb549 user: serhiy.storchaka tags: x11-wm-hidden-state, core-x11-wm-hidden-state

16:54
Fix [d01ec103c0]: After "wm withdraw .;wm state . iconic", "wm state ." always returns "withdrawn"

TkpWmSetState() did not clear the withdrawn flag when iconifying a window which has not been mapped yet. leaf check-in: 43c68112 user: serhiy.storchaka tags: x11-wm-state-iconic, core-x11-wm-state-iconic

16:11
Fix [35e67b8124]: tk sysnotify crashes after the interpreter which used it was deleted

libnotify registers GObject types, which cannot be unregistered, so it cannot be loaded again after unloading. Keep it loaded for the lifetime of the process. leaf check-in: dc39bb00 user: serhiy.storchaka tags: sysnotify-no-unload, core-sysnotify-no-unload

16:02
Fix [8da7af2f8e]: slow widget creation if default font is not used

An unused font is now kept in the cache until idle time instead of being deleted immediately, since it is often needed again soon: the default font of a widget is released when the widget is created with another -font value, and loading it again for every widget is expensive. leaf check-in: 722c9cb1 user: serhiy.storchaka tags: font-deferred-free, core-font-deferred-free

15:59
Merge 9.0 check-in: ca523207 user: jan.nijtmans tags: trunk, main
15:58
Fix [edd1a68d6e]: Lack of bounds checking in argument parsing for some widgets

Port [c289f69486] from core-8-6-branch: frame, toplevel and labelframe crashed when the last option had no value. Add tests. leaf check-in: d938d1b9 user: jan.nijtmans tags: core-9-0-branch

15:31
Fix [e7fc29ce4c]: Performance problems with "photo copy -to"

After writing a block into a photo image, only the changed pixels are scanned for partial transparency. The whole image is rescanned only if it was known to have partially transparent pixels and the block has none. leaf check-in: a01e7adf user: serhiy.storchaka tags: photo-copy-complex-alpha, core-photo-copy-complex-alpha

15:08
Fix [9438cce0bd]: Scrolling a frame in a canvas is very slow since TIP 262

Since [17cd34336f] (TIP 262) a frame was always drawn through a pixmap covering the whole frame, even without a background image. A frame scrolled in a canvas is redrawn on every scroll step, and its pixmap may be huge. Now only frames with a background image or a labelframe label are double-buffered, as before. leaf check-in: 45dcda3d user: serhiy.storchaka tags: frame-no-pixmap, core-frame-no-pixmap

13:28
Fix [31085d2747]: do not create the window of a ttk widget until it is mapped

Since [97048e9881] the ttk widget constructor called Tk_MakeWindowExist(), so on Windows every ttk widget consumed a window handle even when never mapped, and 10000 of them exhausted the per-process handle quota. Classic widgets create their windows only when mapped. The layout is now updated on the first MapNotify event instead, since <<ThemeChanged>> events are not delivered to unrealized windows. The tests which generated events on never mapped widgets now map them first. leaf check-in: 7fc6686e user: serhiy.storchaka tags: ttk-lazy-window-creation, core-ttk-lazy-window-creation

12:30
Fix [881d3f6514]: test config-2.1 fails with "-singleproc 0"

The option table reference counts also include the option objects with cached lookups from previous tests, so compare the counts before and after the deletion instead of using absolute values. leaf check-in: d2ab551e user: serhiy.storchaka tags: config-test-refcounts, core-config-test-refcounts

11:38
Fix [35a8df9a42]: tk_getOpenFile & Co fail on Windows with "CoInitialize has not been called" if no toplevel has been mapped yet

Since [03ce8fe9d1] tkWinDialog.c relied on CoInitialize() being called in UpdateWrapper(), which happens only when a toplevel is mapped. leaf check-in: cf189c70 user: serhiy.storchaka tags: win-dialog-coinitialize, core-win-dialog-coinitialize

11:00
Fix [fef61fae66]: reject unknown -format options in the GIF, PNG and PPM photo image handlers leaf check-in: 1534f184 user: serhiy.storchaka tags: photo-format-options-check, core-photo-format-options-check
10:46
Fix [7f05a19378]: Application crash on Windows when destroying toplevel that is "not responding"

TkWmStackorderToplevel() left the first entries of the returned array uninitialized when EnumWindows() found fewer toplevels than expected, e.g. the toplevel being destroyed, whose window was already destroyed but which was still flagged as mapped after it stopped responding. CheckForPointer() then dereferenced them. leaf check-in: 502eb15e user: serhiy.storchaka tags: win-stackorder-dead-toplevel, core-win-stackorder-dead-toplevel

10:26
Fix [f7d4e4102e]: [$canvas postscript] crashes on X11 with never mapped windows

CanvasPsWindow() now skips unmapped windows, since XGetImage() cannot copy them anyway: it fails with BadMatch for an existing unmapped window, and with BadDrawable, which was not caught, for a window which was never created. leaf check-in: 3be01a1c user: serhiy.storchaka tags: canvas-ps-unmapped-window, core-canvas-ps-unmapped-window

10:02
Fix [edd1a68d6e]: Lack of bounds checking in argument parsing for some widgets

Port [c289f69486] from core-8-6-branch: frame, toplevel and labelframe crashed when the last option had no value. Add tests. closed check-in: 0f5f1d83 user: serhiy.storchaka tags: frame-option-parity

09:29
Fix [3141377]: [winfo screenwidth/height] fail to track resolution changes on X11

Use the XRandR extension, if available, to be notified of changes of the screen size and to update the size recorded by Xlib. The size in millimeters is scaled with it, so that [tk scaling] does not change. leaf check-in: ae3b099b user: serhiy.storchaka tags: core-x11-randr-screen-size, x11-randr-screen-size

08:34
Fix [2225507]: Win32 menu keyboard traversal broken

On Windows the native menu of a menubutton is dismissed before MbPost returns, and the keyboard traversal did not unpost the menubutton afterwards, so its menu could not be posted by keyboard again. leaf check-in: cad6b369 user: serhiy.storchaka tags: bug-2225507

07:13
(cherry-pick): Follow-up to [3cb7c4ac72]: don't clamp the result of Tk_GetUserInactiveTime() on Windows check-in: 5d02ed55 user: jan.nijtmans tags: core-9-0-branch