Solved Struggling to enable Mozc on libreoffice (on MATE Desktop)

Description of the issue:

On libreoffice-7.0.3.1 it is unable to activate ja-fcitx-mozc.

I successfully set up to run Mozc on other programs such as firefox, atom-ide, and Pluma. So far I got this issue on Libreoffice only.

On Libreoffice you can change a locale from English to Japanese, but you cannot input Japanese characters with Mozc at all. Even input from virtual keyboard is not reflected on Libreoffice.

Steps to reproduce the issue:

Run: sudo pkg install -y ja-fcitx-mozc zh-fcitx-configtool
Run: sudo pkg install -y libreoffice
Open Libreoffice Writer
Run: fcitx
Select Mozc from Input Methond menu on Fcitx tray icon

Expected result:

Mozc should be activated on Libreoffice.

Actual result:

Mozc cannot be activated. Clicking keys on virtual keyboard also does not send characters.

Information:

- Version: FreeBSD 12.2-Release
- Desktop Environment: MATE

Any hints are appreciated.

----

Edit: As my post below shows (https://forums.freebsd.org/threads/...ibreoffice-on-mate-desktop.77864/#post-485727), it seems that this is a compatibility issue between MATE Desktop and Libreoffice with regard to GTK+ 2 support.
 
Last edited:
I cannot duplicate the issue. I am using openbox. I have
ja-fcitx-mozc-2.23.2815.102.01_1
ja-mozc-server-2.23.2815.102.01_1
fcitx-qt5-1.2.5
ja-fcitx-mozc-2.23.2815.102.01_1
zh-fcitx-4.2.9.7
I'm not sure why I have that last one, I suspect it was pulled in as a dependency. (For anyone reading this who is unfamiliar with the packages, zh is for Chinese input).
And I have libreoffice-7.0.3.1_2

All installed from packages.

In ~/.xinitrc I have
Code:
export XMODIFIERS=@im=fcitx
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
#export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8[/code

(I boot into text mode and then run startx, using either openbox or dwm and if I need Japanese input, will start fcitx once in X).

As I mention on a dated page of mine, https://srobb.net/jpninpt.html, I was once unable to get it working in firefox (though it was working in libreoffice).
But in that case (hasn't happened for awhile but may be worth trying), I had to start firefox with
[code]
LC_CTYPE=ja_JP.UTF-8 firefox
To get Japanese working with it. Maybe that would work for you.

Since it works in everything but libreoffice, it's probably not Mate grabbing keys. Out of curiosity, are you able to type Japanese in an xterm and paste it into libreoffice and have that work?[/code]
 
As I mention on a dated page of mine, https://srobb.net/jpninpt.html, I was once unable to get it working in firefox (though it was working in libreoffice).
But in that case (hasn't happened for awhile but may be worth trying), I had to start firefox with
Code:
LC_CTYPE=ja_JP.UTF-8 firefox
To get Japanese working with it. Maybe that would work for you.

I should have mentioned that I checked both pages :-)

- https://srobb.net/jpninpt.html
- https://forums.freebsd.org/threads/japanese-input-in-freebsd-10.46315/

Those helped me a lot!

Out of curiosity, are you able to type Japanese in an xterm and paste it into libreoffice and have that work?

I noticed that just now that it is not possible to activate Mozc on `xterm` either. Clicking the fcitx tray icon does not switch languages at all there.
 
Glad to hear that my page helped somewhat. But the way I have it set, I only enable mozc with ctl+space, I don't use the icon. I typed, "an xterm" I should have said an xterm that supports Japanese, e.g., uxterm, st, or urxvt (which is what I use).

But for the heck of it, can you type Japanese in firefox and paste it into libreoffice? What I'm trying to see here is if there's something in libreoffice that is simply not supporting Japanese text. In the old days, and this may have just been with openoffice, I had to go to tools=>language settings and add support for Asian languages, but I don't even see that option. Maybe installing the ja-libreoffice package might help? It's hard to tell because I don't have the problem. If it wasn't working in firefox, I'd wonder about missing gtk packages but it's working in mozilla, right?
 
AHA! I think I figured it out. I had a laptop with FreeBSD but no fcitx-mozc. Installed that, installed libreoffice and no Japanese. Tried various things similar to my suggestions here, but no go.
Then I installed fcitx-qt5 and it worked. So it seems that that's the key. I don't remember installing it on the installation where libreoffice was working with Japanese, perhaps it was pulled in as a dependency. So please try installing fcitx-qt5 and let me (err us, but as my wife will happily tell everyone here, I'm very selfish), if it works.
One thing I didn't bother trying, but would guess that it would have worked, would be using abiword rather than libreoffice (assuming documents are what you need.) I think abiword is a gtk app, (though I thought libreoffice could use both, apparently, I'm wrong.)
 
AHA! I think I figured it out. I had a laptop with FreeBSD but no fcitx-mozc. Installed that, installed libreoffice and no Japanese. Tried various things similar to my suggestions here, but no go.
Then I installed fcitx-qt5 and it worked. So it seems that that's the key. I don't remember installing it on the installation where libreoffice was working with Japanese, perhaps it was pulled in as a dependency. So please try installing fcitx-qt5 and let me (err us, but as my wife will happily tell everyone here, I'm very selfish), if it works.
One thing I didn't bother trying, but would guess that it would have worked, would be using abiword rather than libreoffice (assuming documents are what you need.) I think abiword is a gtk app, (though I thought libreoffice could use both, apparently, I'm wrong.)
Thanks for digging! Currently I am compiling MATE and ja-libreoffice on Ports Collection, and still not finished yet, since this is my first installation. Of course I will let you know about the result of your suggestion with fcitx-qt5.
 
As far as I can tell, you can just use libreoffice without ja-libreoffice, but I was using packages. Anyway, let me know how it goes.
 
As far as I can tell, you can just use libreoffice without ja-libreoffice, but I was using packages. Anyway, let me know how it goes.

Thanks for your suggestions! Unfortunately compiling only fcitx-qt5 did not pull Japanese IME. However, I think compiling libreoffice with the GTK3 option did the trick, and now it is possible to use Mozc on Libreoffice.

I assume there is a compatibility issue on MATE with GTK+ 2 application, since GTK+ 2 code has been dropped from MATE since a couple of years: https://www.omgubuntu.co.uk/2017/03/mate-1-18-desktop-released-now-gtk3. If it is so, basically this is a matter between MATE and Libreoffice (I am not able to confirm that).

Here are the enabled options on cd /usr/ports/editors/libreoffice && make config-recursive:
CUPS, GTK3, KF5, MMEDIA, QT5, WEBDAV. The GTK+ 3 option says that it is an incomplete visual style (and build on your own risk). See Notes from UPDATING too: https://www.freshports.org/editors/libreoffice/. Since I have not tested the build thoroughly, I am still not sure what it breaks.

For your information, these are what I did to build MATE, Libreoffice and Mozc from Ports Collection (also building LightDM and Japanese fonts). Let me note that I have enabled linux.

Code:
# cd /usr/ports/x11/mate/
# make config-recursive
# make install clean

# sysrc moused_enable=yes dbus_enable=yes hald_enable=yes

# cd /usr/ports/x11/lightdm
# make config-recursive
# make install clean

# cd /usr/ports/x11/lightdm-gtk-greeter
# make config-recursive
# make install clean

# shutdown -r now

# lightdm

# cd /usr/ports/editor/libreoffice/
# make config-recursive
# make install clean

# cd /usr/ports/japanese/libreoffice/
# make config-recursive
# make install clean

# cd /usr/ports/textproc/fcitx-qt5/
# make config-recursive
# make install clean

# cd /usr/ports/japanese/fcitx-mozc
# make config-recursive
# make install clean

# cd /usr/ports/japanese/font-std
# make config-recursive
# make install clean

I could just wish developers would be able to fix visual glitches to make GTK+ 3 option set by default.

Please let me know if I log this issue on a bug tracker. Thanks!
 
I think it could be considered a bug, but I'm not sure against what. Against ja-libreoffice? I don't think so because I can get it working without even installing ja-libreoffice. I see that libreoffice itself has qt5, but not gtk3 compiled in if you take defaults. So, I was able to use packages with no problem, once I included fcitx-qt5.
So, I just installed (having a system with openbox that was running already)
fcitx-mozc, font-jis-misc, fcitx-qt5 and libreoffice, all from packages, to get it working.
Now, I do think, if you treat it as request for enhancement, that you could file it on bugzilla against libreoffice (not ja-libreoffice). Just mention the issue you found, and there are probably other gtk3 packages that might use it in libreoffice.
For example, with ffmpeg, someone filed a request to included libx265 in the default package, and it was added. So nowadays, if you install ffmpeg from packages, you can encode and decode libx265 files.

Anyway, I'm glad you got it working.
 
Follow-up: today I found that Mozc could be enabled on neither KeepassXC nor albert.


Both UI are written in Qt5, and I suspect neither gtk2 nor Qt5 is connected to fcitx properly.
 
Back
Top