Tk Source Code

View Ticket
Login
Ticket UUID: 1919791
Title: XIM reorganization and cleanup
Type: Patch Version: None
Submitter: jenglish Created on: 2008-03-19 16:00:55
Subsystem: 67. Unix Window Operations Assigned To: dgp
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2008-03-27 02:02:42
Resolution: Accepted Closed By: jenglish
    Closed on: 2008-03-26 19:02:42
Description:
Attached patch reorganizes and attempts to streamline Tk's XIM processing.

It does not (to my knowledge) fix any of the outstanding XIM-related bugs in Tk, but I'd like to get it into Tk 8.5.2 anyway in the hopes of making those easier to debug in future.
User Comments: jenglish added on 2008-03-27 02:02:42:

File Added - 271972: tk-xim-reorg-2.patch

Logged In: YES 
user_id=68433
Originator: YES

Revised patch makes Tk_SetCaretPos() a no-op if called twice in a row with the same arguments, to avoid excessive calls to XSetICValues(... XnSpotLocation ...).

I'm confident in this version; committing.
File Added: tk-xim-reorg-2.patch

jenglish added on 2008-03-19 23:10:52:
Logged In: YES 
user_id=68433
Originator: YES

Summary of changes:

+ Merged #ifdef TK_XIM_SPOT code branches and streamlined input style selection logic.
+ (dispPtr->flags & TK_DISPLAY_XIM_SPOT) subsumed by (dispPtr->inputStyle & XIMPreeditPosition).
+ Set preedit spot location in Tk_SetCaretPos() instead of in TkpGetString.
+ Allocate dispPtr->inputXfs in OpenIM() instead of from within InvokeInputMethods().
+ Adjust window event mask at XCreateIC() time instead of at each FocusIn event.
+ Call XSetICFocus on FocusIn events regardless of IM event mask.

Consequences:

+ This adds a new field to struct TkDisplay; CVS users will need to make clean and recompile.
+ XNSpotLocation gets set more often than it used to (in general: whenever the insert cursor blinks; previously it was not set until Tk processed a KeyPress event).
+ XSetICFocus gets called in conditions where it formerly did not.
+ Window event mask is adjusted at most once instead of once per FocusIn event.
+ dispPtr->intpuXfs gets allocated earlier.

I believe the new behavior is "more correct" in all cases.

jenglish added on 2008-03-19 23:00:56:

File Added - 271057: tk-xim-reorg.patch

Attachments: