Description: SurroundingText capability is used by some input method like fcitx, ibus... It's broken in kf5 vcl but still works in the gtk mode. Steps to Reproduce: 1. Install fcitx5-unikey and run it 2. With fcitx5-unikey, in Libre Writer, type: g[space][backspace]ias Actual Results: gía Expected Results: giá Reproducible: Always User Profile Reset: No Additional Info: .
(In reply to trmdi from comment #0) > Steps to Reproduce: > 1. Install fcitx5-unikey and run it Can you please explain in more detail what "run it" means, i.e. how to (set it up if necessary and) run it? I have installed package "fcitx5-unikey" in Debian testing, but I don't see any obvious executable to just run in the 'dpkg -L fcitx5-unikey' output, so maybe this needs to be set up and run in a certain way with the fcitx framework that I know little about? A step-by-step description to do so would be very helpful here.
1) Install fcitx5-unikey 2) Open Fcitx5 and find and add Unikey to current input 3) Run im-config, choose fcitx5, and set fcitx5 to auto start 4) Log out and log in, Ctrl + Space switch im to Unikey and type in LibreOffice Fcitx5 similar ibus
Thanks, I can reproduce the described difference between the gtk3 VCL plugin on the one side and kf5 or qt6 on the other side. However, this doesn't look LibreOffice-specific to me, since I can reproduce the same with other Gtk/Qt-based applications: * When I type "g[space][backspace]ias" in gedit (based on gtk), this results in "giá". * When I type "g[space][backspace]ias" in kate or Konsole (Qt-based), I get "gía". Therefore, I tend to think that this is probably rather an issue in either Qt or the fcitx Qt integration (package "libfcitx5-qt1"?) instead of LibreOffice and would suggest to report that there instead. Closing as NOTOURBUG for now due to these observations, but this can of course be reopened if other findings suggest that something actually needs to be done on LO side. Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: d640bfe7767292c8a89de57d378dd752a8ec8342 CPU threads: 12; OS: Linux 6.0; UI render: default; VCL: gtk3 Locale: en-GB (en_GB.UTF-8); UI: en-US Calc: threaded Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: d640bfe7767292c8a89de57d378dd752a8ec8342 CPU threads: 12; OS: Linux 6.0; UI render: default; VCL: kf5 (cairo+xcb) Locale: en-GB (en_GB.UTF-8); UI: en-US Calc: threaded Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: d640bfe7767292c8a89de57d378dd752a8ec8342 CPU threads: 12; OS: Linux 6.0; UI render: default; VCL: qt6 (qfont+xcb) Locale: en-GB (en_GB.UTF-8); UI: en-US Calc: threaded
(In reply to Michael Weghorn from comment #3) > Therefore, I tend to think that this is probably rather an issue in either > Qt or the fcitx Qt integration (package "libfcitx5-qt1"?) instead of > LibreOffice and would suggest to report that there instead. i.e., probably here: https://github.com/fcitx/fcitx5-qt/issues (or https://bugreports.qt.io for the Qt case)
(In reply to Michael Weghorn from comment #3) > Thanks, I can reproduce the described difference between the gtk3 VCL plugin > on the one side and kf5 or qt6 on the other side. > > However, this doesn't look LibreOffice-specific to me, since I can reproduce > the same with other Gtk/Qt-based applications: > > * When I type "g[space][backspace]ias" in gedit (based on gtk), this results > in "giá". > > * When I type "g[space][backspace]ias" in kate or Konsole (Qt-based), I get > "gía". > > Therefore, I tend to think that this is probably rather an issue in either > Qt or the fcitx Qt integration (package "libfcitx5-qt1"?) instead of > LibreOffice and would suggest to report that there instead. > > Closing as NOTOURBUG for now due to these observations, but this can of > course be reopened if other findings suggest that something actually needs > to be done on LO side. > > > Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community > Build ID: d640bfe7767292c8a89de57d378dd752a8ec8342 > CPU threads: 12; OS: Linux 6.0; UI render: default; VCL: gtk3 > Locale: en-GB (en_GB.UTF-8); UI: en-US > Calc: threaded > > Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community > Build ID: d640bfe7767292c8a89de57d378dd752a8ec8342 > CPU threads: 12; OS: Linux 6.0; UI render: default; VCL: kf5 (cairo+xcb) > Locale: en-GB (en_GB.UTF-8); UI: en-US > Calc: threaded > > Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community > Build ID: d640bfe7767292c8a89de57d378dd752a8ec8342 > CPU threads: 12; OS: Linux 6.0; UI render: default; VCL: qt6 (qfont+xcb) > Locale: en-GB (en_GB.UTF-8); UI: en-US > Calc: threaded Konsole doesn't support that, but Kate does. The SurroundingText capability need support from the app. So I opened this request here to get the support from LibreOffice's kf5 vcl.
> When I type "g[space][backspace]ias" in kate or Konsole (Qt-based), I get "gía". Probably something's wrong with your setup. It does support that here on my openSUSE Tumbleweed, Kate 22.12.0
Created attachment 184243 [details] working in Kate
The issue for libreoffice is that, although it implements the surrounding support. Like: https://github.com/LibreOffice/core/blob/d57836db76fcf3133e6eb54d264c774911015e08/vcl/qt5/QtWidget.cxx#L893 It doesn't seem to notify input method about surrounding changes, which is usually done with QWidget::updateMicroFocus(), or call QGuiApplication::inputMethod()->update(FLAGS). ``` void QWidget::updateMicroFocus() { // updating everything since this is currently called for any kind of state change if (this == QGuiApplication::focusObject()) QGuiApplication::inputMethod()->update(Qt::ImQueryAll); } ``` I can only find libreoffice's qt implementation notifies about cursor rectangle change at https://github.com/LibreOffice/core/blob/d57836db76fcf3133e6eb54d264c774911015e08/vcl/qt5/QtWidget.cxx#L628
While it is possible to implement a polling like logic. Retrieving surrounding text is an expensive query, so I'd prefer libreoffice to notify the change instead of letting input method poll it. Also, the implementation itself seems not working properly. Even if I tried to hack fcitx5-qt to poll the surrounding text by explicitly query the object, it return value for inputMethodQuery(Qt::ImSurroundingText) is still QVariant(Invalid). So despite of adding qApp->inputMethod()->update(Qt::ImSurroundingText | Qt::ImCursorPosition | Qt::ImAnchorPosition) to a proper place maybe also check if this lcl_retrieveSurrounding actually works. https://github.com/LibreOffice/core/blob/d57836db76fcf3133e6eb54d264c774911015e08/vcl/qt5/QtWidget.cxx#L897 Gtk counterpart seems to use a different approach for retrieving surrounding https://github.com/LibreOffice/core/blob/83485052e6cac574754191c59371dbc41383b810/vcl/unx/gtk3/gtkframe.cxx#L5824
(In reply to trmdi from comment #6) > Probably something's wrong with your setup. It does support that here on my > openSUSE Tumbleweed, Kate 22.12.0 Indeed, was apparently some problem with my setup, since I was using the same Kate version. It works now. Interestingly, I explicitly have to unset GTK_IM_MODULE (or set it to an empty string) because GTK_IM_MODULE=fcitx breaks the LO Writer use case with gtk3 (still works with Calc or gedit, though...). (In reply to Xuetian Weng from comment #9) > While it is possible to implement a polling like logic. Retrieving > surrounding text is an expensive query, so I'd prefer libreoffice to notify > the change instead of letting input method poll it. > > Also, the implementation itself seems not working properly. Even if I tried > to hack fcitx5-qt to poll the surrounding text by explicitly query the > object, it return value for inputMethodQuery(Qt::ImSurroundingText) is still > QVariant(Invalid). > > So despite of adding qApp->inputMethod()->update(Qt::ImSurroundingText | > Qt::ImCursorPosition | Qt::ImAnchorPosition) to a proper place maybe also > check if this lcl_retrieveSurrounding actually works. > https://github.com/LibreOffice/core/blob/ > d57836db76fcf3133e6eb54d264c774911015e08/vcl/qt5/QtWidget.cxx#L897 > > Gtk counterpart seems to use a different approach for retrieving surrounding > https://github.com/LibreOffice/core/blob/ > 83485052e6cac574754191c59371dbc41383b810/vcl/unx/gtk3/gtkframe.cxx#L5824 Thank you so much, this is extremely helpful! I have experimented a bit locally and have had a first quick-and-dirty version that somewhat works (but breaks other things), but needs more work for a proper solution.
Dear trmdi, To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to 'inherited from OOo'; 4b. If the bug was not present in 3.3 - add 'regression' to keyword Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug
The bug is still present. Version: 24.8.3.2 (X86_64) / LibreOffice Community Build ID: 480(Build:2) CPU threads: 4; OS: Linux 6.11; UI render: default; VCL: kf6 (cairo+wayland) Locale: en-US (en_US.UTF-8); UI: en-US Calc: threaded
It also don't work on gtk VLC up to now!
(In reply to Phoenix from comment #13) > It also don't work on gtk VLC up to now! Please create a separate bug report with more details for that, as it was reported to work fine previously (s. initial description here). And please don't change the version field to a later version just because the problem is still present; it should be set to the earliest version affected.
(In reply to Michael Weghorn from comment #10) > I have experimented a bit locally and have had a first quick-and-dirty > version that somewhat works (but breaks other things), but needs more work > for a proper solution. I'm sorry it took so long, but there is finally a pending change series in Gerrit which makes this work for me: https://gerrit.libreoffice.org/c/core/+/190748 (and underlying changes)
Michael Weghorn committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/441e80546b54641661d5654f5aa4c3615753733d tdf#152519 qt: Update more IM query atttributes It will be available in 26.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Michael Weghorn committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/86bf2e50fc64b8789154f3993567ceeed012e60c tdf#152519 Distinguish cursor/anchor for IM selection It will be available in 26.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Michael Weghorn committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/8ebbda5ebe1686f175ed00502d85655ac1977a8e tdf#152519 vcl: Merge both ImplHandleSalSurroundingTextRequest It will be available in 26.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Michael Weghorn committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/fc6e57f77e2ba0c6fd2523d8e23e68924963ed76 tdf#152519 vcl: Fix potential copy paste error in IM code It will be available in 26.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Michael Weghorn committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/ba10746f37b6176d2fa4aca85fc1c786f8e812e2 tdf#152519 vcl: Report IM cursor position It will be available in 26.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Michael Weghorn committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/d76a7977bc9c808144ce68276ab3509c9dc54865 tdf#152519 qt: Port IM handling from a11y to dedicated API It will be available in 26.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
(In reply to Michael Weghorn from comment #15) > I'm sorry it took so long, but there is finally a pending change series in > Gerrit which makes this work for me: > > https://gerrit.libreoffice.org/c/core/+/190748 (and underlying changes) Merged now. Further testing (with daily builds from tomorrow or newer) and feedback very welcome!