Bug 149932 - When using ibus input methods, the underlining style set by the input method is ignored in the gtk3 backend.
Summary: When using ibus input methods, the underlining style set by the input method ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
7.3.4.2 release
Hardware: All All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.5.0 target:7.4.4
Keywords:
Depends on:
Blocks: GTK3
  Show dependency treegraph
 
Reported: 2022-07-09 20:38 UTC by Mike FABIAN
Modified: 2022-11-09 09:54 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Video showing that the setting for the underlining of the preedit has no effect on libreoffice. See gedit for comparison in the video, in other programs like gedit it works. (383.16 KB, video/mp4)
2022-07-09 20:38 UTC, Mike FABIAN
Details
The video showing that the underlining styles work partially when SAL_USE_VCL_PLUGIN=kf5 is used (629.24 KB, video/mp4)
2022-07-09 20:44 UTC, Mike FABIAN
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike FABIAN 2022-07-09 20:38:58 UTC
Created attachment 181198 [details]
Video showing that the setting for the underlining of the preedit has no effect on libreoffice. See  gedit for comparison in the video, in other programs like gedit it works.

Using libreoffice-writer-7.3.4.2-1.fc36.x86_64 on Fedora 36.



See attached video using the ibus engine “ibus-typing-booster”: The video shows that the underlining style is honoured by gedit but not by libreoffice.

(ibus-typing-booster is just an example, there are other ibus engines which support different settings for the underline style of the preedit, none of them works, the preedit in libreoffice is *always* underline with a single, solid underline).
Comment 1 Mike FABIAN 2022-07-09 20:42:15 UTC
I found a partial workaround for this problem, see:


https://github.com/ibus/ibus/issues/2420#issuecomment-1179340110

First, the libreoffice-kf5 needs to be installed, on Fedora it can be installed like this:

sudo dnf install libreoffice-kf5

Then set this environment variable before starting libreoffice:

export SAL_USE_VCL_PLUGIN=kf5

and then start libreoffice:

oowriter &

Now switching off the underline works as you can see in the video:

(The “Low” underline makes a dotted underline, the “Double” underline looks the same as the “Single” underline, but “None” does indeed show no underline at all with export SAL_USE_VCL_PLUGIN=kf5)
Comment 2 Mike FABIAN 2022-07-09 20:44:26 UTC
Created attachment 181199 [details]
The video showing that the underlining styles work partially when SAL_USE_VCL_PLUGIN=kf5 is used
Comment 3 Caolán McNamara 2022-11-02 19:40:31 UTC
impl for this is vcl/unx/gtk3/gtkframe.cxx:5727 we have...

while (tmp_list)
{
    PangoAttribute *pango_attr = static_cast<PangoAttribute *>(tmp_list->data);

    switch (pango_attr->klass->type)
    {
        case PANGO_ATTR_BACKGROUND:
            sal_attr |= ExtTextInputAttr::Highlight;
            rCursorFlags |= EXTTEXTINPUT_CURSOR_INVISIBLE;
            break;
        case PANGO_ATTR_UNDERLINE:
            sal_attr |= ExtTextInputAttr::Underline;
            break;
        case PANGO_ATTR_STRIKETHROUGH:
            sal_attr |= ExtTextInputAttr::RedText;
            break;
        default:
            break;
    }
    pango_attribute_destroy (pango_attr);
    tmp_list = tmp_list->next;
}
if (sal_attr == ExtTextInputAttr::NONE)
    sal_attr |= ExtTextInputAttr::Underline;

so we're probably setting underline at the end for the "NONE" case that might be in question here.
Comment 4 Commit Notification 2022-11-03 17:19:40 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/57e0b4344111431e0a26622920b35dfc7d9e8ff8

Related: tdf#149932 honour PANGO_UNDERLINE_NONE for preedit underline

It will be available in 7.5.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.
Comment 5 Commit Notification 2022-11-03 19:49:38 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/d1cd19b56d5fefaa6f41a4d70e748331525820a4

Related: tdf#149932 honour PANGO_UNDERLINE_DOUBLE for preedit underline

It will be available in 7.5.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.
Comment 6 Commit Notification 2022-11-03 19:49:46 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6c0ac70a512c1789d26721bd1f7d01a8b24fa718

Related: tdf#149932 map NSUnderlineStyleDouble to new DoubleUnderline

It will be available in 7.5.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.
Comment 7 Caolán McNamara 2022-11-03 19:50:24 UTC
backport to 7-4 in gerrit for review
Comment 8 Caolán McNamara 2022-11-03 19:51:35 UTC
and as an aside patch is in libreoffice-7.3.6.2-4.fc36 fedora testing updates
Comment 9 Commit Notification 2022-11-09 09:54:40 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/8dc6896254dbca4f9cd56f55edf2af85b226b4fd

Resolves: tdf#149932 honour preedit PANGO_UNDERLINE_NONE/PANGO_UNDERLINE_DOUBLE

It will be available in 7.4.4.

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.