Tk Source Code

Check-in [894c1665]
Login

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

Overview
Comment:Fix [5d52ad92fa]: creating widgets is slow when an input method is active

Tk created an X input context for every window as soon as it got any event, and every creation costs a round trip to the input method. With ibus running this made the creation of widgets about ten times slower: 480 labels took about 470 ms instead of 36 ms, and the delay grew with the number of widgets.

Now the input context is created only for a toplevel and for the window which receives the focus, which is where it is used. With ibus the same 480 labels take 20-29 ms and 480 entries 6-7 ms. Based on the approach of the abandoned bug-xim branch by Brad Lanam.

Downloads: See separate download page
Timelines: family | ancestors | descendants | both | x11-lazy-xic
Files: files | file ages | folders
SHA3-256: 894c1665c52364ab482994838167a5ca613f09592b43f91436013bf3cd439c2a
User & Date: serhiy.storchaka 2026-09-23 20:28:55.825
Context
2026-09-25
14:13
Fix [5d52ad92fa]: creating widgets is slow when an input method is active check-in: e978f0d4 user: jan.nijtmans tags: trunk, main
2026-09-23
20:28
Fix [5d52ad92fa]: creating widgets is slow when an input method is active

Tk created an X input context for every window as soon as it got any event, and every creation costs a round trip to the input method. With ibus running this made the creation of widgets about ten times slower: 480 labels took about 470 ms instead of 36 ms, and the delay grew with the number of widgets.

Now the input context is created only for a toplevel and for the window which receives the focus, which is where it is used. With ibus the same 480 labels take 20-29 ms and 480 entries 6-7 ms. Based on the approach of the abandoned bug-xim branch by Brad Lanam. closed check-in: 894c1665 user: serhiy.storchaka tags: x11-lazy-xic

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/tkEvent.c.