Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fcitx not work in KeePassXC on Linux. Please add libfcitxplatforminputcontextplugin.so to AppImage #1077

Closed
zuishikonghuan opened this issue Oct 16, 2017 · 11 comments
Assignees
Milestone

Comments

@zuishikonghuan
Copy link

@zuishikonghuan zuishikonghuan commented Oct 16, 2017

English is not my native language; please excuse typing errors.

Expected Behavior

fcitx works in KeePassXC AppImage. I can use fcitx to type.

Current Behavior

Fcitx does not work in KeePassXC AppImage but fcitx can be used in other qt5 programs, like cmake-gui.

Possible Solution

compile and add libfcitxplatforminputcontextplugin.so to AppImage. The file is a part of Qt5.

Steps to Reproduce (for bugs)

compile and add libfcitxplatforminputcontextplugin.so to AppImage. The file is a part of Qt5.

Context

I copy system's libfcitxplatforminputcontextplugin.so to KeePassXC, it works!

firstly, run AppImage.
then, cp -a /tmp/.mount_xxxx /tmp/kp, and close KeePassXC window
then, copy system's libfcitxplatforminputcontextplugin.so

cp -a /usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/ /tmp/kp/opt/qt59/plugins

and run AppRun

fcitx works!

but KeePassXC uses a self-compiled Qt library. Use system's libfcitxplatforminputcontextplugin.so is not good. And doing this breaks the AppImage.

Please add libfcitxplatforminputcontextplugin.so, thank you very much!

Debug Info

KeePassXC - 2.2.1-x86_64

Operating system: Ubuntu 16.04 LTS
CPU architecture: x86_64
Kernel: Linux 4.10.0-35-generic #39~16.04.1-Ubuntu

Enabled extensions:
None

@yan12125

This comment has been minimized.

Copy link
Contributor

@yan12125 yan12125 commented Oct 16, 2017

libfcitxplatforminputcontextplugin.so is part of fcitx-qt5, which is a third-party library of Qt.

@zuishikonghuan

This comment has been minimized.

Copy link
Author

@zuishikonghuan zuishikonghuan commented Oct 16, 2017

@yan12125 I am very sorry. I did not go to carefully verify, and take it for granted that. thank you for your reply.
In this case, can you add an option to the settings interface that allows loading of the qt plugin installed in the system.(/usr/lib/x86_64-linux-gnu/qt5/plugins/).

@phoerious

This comment has been minimized.

Copy link
Member

@phoerious phoerious commented Oct 16, 2017

I don't think this is possible. Yes, we could try loading a DLL at runtime, but we have no guarantees that it'll work and not crash KeePassXC.

@zuishikonghuan

This comment has been minimized.

Copy link
Author

@zuishikonghuan zuishikonghuan commented Oct 16, 2017

@phoerious If you add a command line switch to it, allow the user to set the QT_PLUGIN_PATH environment variable to the system directory. Rather than let the startup script override it. Can the modification can be accepted?
There may be other users who need to use a im like fcitx.This may help to avoid trouble with another person

@phoerious

This comment has been minimized.

Copy link
Member

@phoerious phoerious commented Oct 16, 2017

You can already override or extend the plugin path. Just start the application with

QT_PLUGIN_PATH="${QT_PLUGIN_PATH}:/usr/lib/x86_64-linux-gnu/qt5/plugins" ./KeePassXC-*.AppImage
@zuishikonghuan

This comment has been minimized.

Copy link
Author

@zuishikonghuan zuishikonghuan commented Oct 16, 2017

@phoerious
But it not work on my system...

I have run it but fcitx still not working

And I find this in /tmp/.mount_KeePasxxxxx/usr/bin/keepassxc_env

export LD_LIBRARY_PATH="../opt/qt59/lib:${LD_LIBRARY_PATH}"
export QT_PLUGIN_PATH="../opt/qt59/plugins"

Are you sure that QT_PLUGIN_PATH haven't been overridden?

@phoerious

This comment has been minimized.

Copy link
Member

@phoerious phoerious commented Oct 16, 2017

The wrapper scripts extends it like this:

export QT_PLUGIN_PATH="..${QT_PLUGIN_PATH}"

Which is kind of incorrect (but in this case required). So you need to add a colon in front of your path to make it work.

@zuishikonghuan

This comment has been minimized.

Copy link
Author

@zuishikonghuan zuishikonghuan commented Oct 16, 2017

@phoerious
It's kinda strange that it does not seem to have access to this environment variable

grep "QT_PLUGIN_PATH" keepassxc_env.wrapper

it give blank output

I am using a 2.2.1 binary AppImage. The release page shows that there are 81 commits. It seems that things have changed (I downloaded the source code 2.2.1, but I did not grep to get any QT_PLUGIN_PATH. I do not understand AppImage. The latest code can grep that). It is the next binary release can solve this problem? Do i need to close this issue?

@phoerious

This comment has been minimized.

Copy link
Member

@phoerious phoerious commented Oct 16, 2017

The correct script is keepassxc_env, not keepassxc_env.wrapper.

@phoerious

This comment has been minimized.

Copy link
Member

@phoerious phoerious commented Oct 16, 2017

Actually, you are right. The variable is already resolved inside the AppImage-Recipe script. Instead of

export QT_PLUGIN_PATH="..${QT_PLUGIN_PATH}"

it should be

export QT_PLUGIN_PATH="..${QT_PLUGIN_PATH}:\${QT_PLUGIN_PATH}"

For LD_LIBRARY_PATH, we already do that. I'll prepare a PR to fix this.

@garywill

This comment has been minimized.

Copy link

@garywill garywill commented Jun 19, 2018

Hello guys, I need help. I am having problem with fcitx.
I can't activate fcitx on KeepassXC window (press control-space or use mouse to click IME icon). Using fcitx on other qt5 programs is ok.

env QT_PLUGIN_PATH="${QT_PLUGIN_PATH}:/usr/lib64/qt5/plugins" ./KeePassXC-2.3.3-x86_64.AppImage

has no effect.

I extract the AppImage (copied /tmp/.mount.... to somewhere else) and copied /usr/lib64/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so to /tmp/KeeP..../opt/qt59/plugins/platforminputcontexts/ then run AppRun, but no effect.

system info

libQt5Core5 5.6.2
fcitx-qt5 1.1.0
fcitx 4.2.9

$ cat /etc/os-release 
NAME="openSUSE Leap"
VERSION="42.3"
ID=opensuse
ID_LIKE="suse"
VERSION_ID="42.3"
PRETTY_NAME="openSUSE Leap 42.3"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:42.3"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"

$ uname -r
4.4.126-48-default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.