Tk Source Code

Check-in [5478e577]
Login

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

Overview
Comment:Fix [1348333fff]: Do not starve idle handlers with many text widgets.

While a redisplay was pending, AsyncUpdateLineMetrics() polled for it with a 1 ms timer. With several hundred text widgets these timers were always due, so the idle handlers, including the redisplay itself, never ran: "update" never returned and the application kept the CPU busy. Now the line metrics update waits for the redisplay in an idle handler instead.

Downloads: See separate download page
Timelines: family | ancestors | descendants | both | text-metrics-idle-wait
Files: files | file ages | folders
SHA3-256: 5478e577505bdd111dbbb1012fce07849c62ea4c39790dfaeec0f155892b514f
User & Date: serhiy.storchaka 2026-09-24 10:53:30.074
Original Comment: Do not starve idle handlers with many text widgets.

While a redisplay was pending, AsyncUpdateLineMetrics() polled for it with a 1 ms timer. With several hundred text widgets these timers were always due, so the idle handlers, including the redisplay itself, never ran: "update" never returned and the application kept the CPU busy. Now the line metrics update waits for the redisplay in an idle handler instead. [Bug 1348333]

Context
2026-10-15
16:42
Rebase to main check-in: b4d7bf8c user: serhiy.storchaka tags: text-metrics-idle-wait
2026-09-24
10:53
Fix [1348333fff]: Do not starve idle handlers with many text widgets.

While a redisplay was pending, AsyncUpdateLineMetrics() polled for it with a 1 ms timer. With several hundred text widgets these timers were always due, so the idle handlers, including the redisplay itself, never ran: "update" never returned and the application kept the CPU busy. Now the line metrics update waits for the redisplay in an idle handler instead. check-in: 5478e577 user: serhiy.storchaka tags: text-metrics-idle-wait

2026-09-23
10:33
Fix for [3de1b72157]: ttk::notebook takes the focus when clicked, even with the -takefocus 0 option. check-in: a695f427 user: csaba tags: trunk, main
Changes
Unified Diff Side-by-Side Diff Patch
Changes to generic/tkTextDisp.c.
Changes to tests/textDisp.test.