[LyX/master] Introducing OnTheSpot-style input method editing & IME integration

Yokota K. yokota6 at gmail.com
Wed Jan 29 09:24:58 UTC 2025


OK, it’s not related to the focus matter.

It seems there are cases Linux raises InputMethodEvent even when the document contains only ASCII letters and no inputs via input method. There are also cases this doesn’t happen in a similar situation.

If this happens, GuiInputMethod::processPreedit() judges it is a cancelation of preedit strings when there were replaced selected strings (GuiInputMethod.cpp L191-195). So we need to distinguish these two cases.

This is a little bit of headache. Please let me think for a moment.

Koji

> 2025/01/29 18:04、Pavel Sanda <sanda at lyx.org>のメール:
> 
> On Wed, Jan 29, 2025 at 11:48:07AM +0900, Yokota K. wrote:
>> I could not reproduce it on Mac, but judging from the fact that the problem occurs when a focus changes, it can be related to calls of inputItemTransform() or setInputItemTransform functions in src/frontends/qt/GuiWorkArea.cpp.
> 
> It's perfectly reproducible here.
> The easiest way: 
> 0. Setup your linux windows manager "Focus follows mouse"
> 1. Load some manual in lyx (file needs to be in read-only mode) and select random text
> 2. Hold Alt key and move focus out of lyx window
> 3. Selected text is removed (or rather CT-deleted), buffer is not set to modified
> 
> Notes:
> - Debug output shows this happens whenever GuiWorkArea.cpp (2e7): GuiWorkArea::focusOutEvent(): 0x55946b6d7a40  happens.
> - Sometimes it happens without focus change while the debug shows: GuiInputMethod.cpp (694): Responded to query Qt::ImCursorRectangle =  x:236 y:161 w:1 h:26
> - I don't see debug messages around (set)inputItemTransform() methods, they might not be involved here
> 
>> If selection is not related, the same phenomena can happen on 2.4.x series, since the modification in GuiWorkArea was already made in LyX 2.4.2.
> 
> I can not reproduce with 2.4.x.
> 
> Pavel



More information about the lyx-devel mailing list