https://bugs.documentfoundation.org/show_bug.cgi?id=160838

            Bug ID: 160838
           Summary: LibreOffice does not report the correct cursor
                    position for IME at certain places unless using gtk3
                    VCL plugin
           Product: LibreOffice
           Version: 24.2.1.2 release
          Hardware: x86-64 (AMD64)
                OS: Linux (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: UI
          Assignee: libreoffice-bugs@lists.freedesktop.org
          Reporter: 1293660...@qq.com

Description:
This bug is move from tdf#160275 to make the description more accurate.

Background information: For a few non-Latin scripts (especially Chinese and
Japanese), an IME (input method engine/editor) is needed for inputting. When an
IME is enabled, the keystrokes on the keyboard is first sent to the IME. The
IME will do the transcription and show a candidate box for you to select the
intended character sequence, as the transcription process is not one-to-one
(e.g. in Chinese Pinyin, shizi → 狮子, 十字, 师资, ...). After you select the
intended candidate, the corresponding character sequence will be inputted. For
ease of inputting, the candidate box is usually shown near the cursor of the
"host" program.

The problem is that LO does not report the correct cursor position at certain
places, so the candidate box will be shown at the wrong position (usually at
the top-left corner of the window). "Certain places" includes:
- Input line of Calc;
- Comment region (Ctrl+Alt+C) of Writer, Impress and Draw (but not Calc);
- Input region of Math.
This only happens at these certain places, and everything works well at other
places.

Furthermore, the IME has different behaviors when using different VCL plugins:
- gtk3: Everything works well (even at the places mentioned above);
- kf5, qt5, kf6, qt6, gen: The candidate box is shown at the wrong position,
but IME is still usable;
- gtk4: IME is not usable at all; every keystroke is directly sent to LO.
Again, this only happens at the places mentioned above.

I noticed that all these places have one thing in common: The cursor does not
blink. I think this should be related to the bug.

Currently, I am using the fcitx5 IME. The 5.1.4 version of fcitx5-qt had a bug
that would cause LO to crash (see tdf#160275) under Wayland, but it was fixed
in the 5.1.6 version. The current bug happens under both Wayland and X11.

Steps to Reproduce:
1. Install the fcitx5 framework and setup it according to the instructions on
the official website;
2. Launch LO (optionally with environment variable SAL_USE_VCLPLUGIN) and
navigate to any one of the above-mentioned places (e.g. comment region of
Writer);
3. Toggle the IME with keyboard shortcut (Ctrl+Space by default);
4. (Optionally) try typing something if you have installed any "usable" IMEs
(see other information below). 

Actual Results:
The candidate box is not shown at the correct position.

Expected Results:
The candidate box should appear around the cursor.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Please bear in mind that fcitx5 itself does not ship with any "usable" IMEs;
only keyboard layouts (which do not use a candidate box actually) are provided.
However, toggling the IME with keyboard shortcut will show an indicator near
the cursor, which shares the same code with the "actual" candidate box and also
fails at the above-mentioned places. You can install a "usable" IME (e.g. Rime
for Chinese, Mozc for Japanese) to summon the "actual" candidate box.

Version: 24.2.2.2 (X86_64) / LibreOffice Community
Build ID: 420(Build:2)
CPU threads: 16; OS: Linux 6.8; UI render: default; VCL: kf6 (cairo+wayland)
Locale: zh-CN (zh_CN.UTF-8); UI: zh-CN
24.2.2-2
Calc: threaded

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to