In brief, sometimes scim is blocked to receive new key events.
The detailed descriptions are here:
The problem happens when scim is working in XIM mode.
I think it is a bug of XIM client or XIM protocol itself.
Anyway, I found a way to work around the bug.
It is to reset all the sync flag and remove the queue, when the focus
I made a patch, which is attached.
Please review it.