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

QT 5.8 plugins/platforminputcontexts/ not deployed #131

Closed
stribor opened this issue Jun 1, 2017 · 19 comments
Closed

QT 5.8 plugins/platforminputcontexts/ not deployed #131

stribor opened this issue Jun 1, 2017 · 19 comments

Comments

@stribor
Copy link

stribor commented Jun 1, 2017

When application is deployed without
plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so
and
plugins/platforminputcontexts/libibusplatforminputcontextplugin.so
user can't use dead keys to type text with accents like ´ á à

@TheAssassin
Copy link
Collaborator

This might be a bug indeed. But you should provide a minimal working example (MWE) so we can reproduce it. Please update your issue, so we can remove the invalid tag.

@stribor
Copy link
Author

stribor commented Jun 1, 2017

It is enough to compile any application that has any kind of text input.
i.e.

cd $(qmake -query QT_INSTALL_EXAMPLES)/widgets/mainwindows/application
qmake
make
mkdir appimage
cp application appimg/

now if you do:
~/linuxdeployqt-continuous-x86_64.AppImage appimg/application
and check folder appimg/plugins/ folder you can see thatplatforminputcontexts is missing

I tried
~/linuxdeployqt-continuous-x86_64.AppImage appimg/application -appimage
and using resulting Application-x86_64.AppImage under linuxmint vm and I couldn't type any dead key combination

but if I do following deployment:

mkdir -p appimage/plugins/platforminputcontexts
   cp $(qmake -query QT_INSTALL_PLUGINS)/platforminputcontexts/libcomposeplatforminputcontextplugin.so $(qmake -query QT_INSTALL_PLUGINS)/platforminputcontexts/libibusplatforminputcontextplugin.so appimg/plugins/platforminputcontexts/

 $/linuxdeployqt-continuous-x86_64.AppImage appimg/application -appimage

than dead keys work fine under vm

@probonopd
Copy link
Owner

Possibly related to "Input methods/IME/ibus ". Do you have any of that in use on your system?

@probonopd
Copy link
Owner

Do we have to deploy all of platforminputcontexts whenever we deploy libQt5Gui?

@stribor
Copy link
Author

stribor commented Jun 1, 2017

I have no problems with other applications. Even building same example on vm runs without problems, also adding
export LD_LIBRARY_PATH=$HOME/Qt5.8.0/5.8/gcc_64/lib
before starting appimage fixes problem.

I'm not sure if both are needed, running opensnoop I see both plugins are opened when application is started.

The same problem happens i.e. with musescore appimage

@stribor
Copy link
Author

stribor commented Jun 1, 2017

I did quick test build one appimage with only
plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so
and another one with only
plugins/platforminputcontexts/libibusplatforminputcontextplugin.so
and in both cases dead keys worked.

I have no idea if it makes sense do deploy both or only one of them. I just know that without them dead keys are dead :)

@probonopd
Copy link
Owner

@stribor are you using, on your system, Input methods/IME/ibus?

@stribor
Copy link
Author

stribor commented Jun 1, 2017

I just want deployed application to run at most distributions as possible.
And for testing I simply downloaded openSUSE 13.2 iso and mint 18.1 iso and installed them under vmware, installed german keyboard layout from default settings applications for testing deployed app.
I have no idea what input methods they use by default I think in m

Googling around I'm guessing libcomposeplatforminputcontextplugin.so would be more general since xcb platform plugin is used and it doesn't have ibus dependency, from https://codereview.qt-project.org/#/c/48185/:

Introducing QComposeInputContext

When switching from Xlib to xcb platform plugin it was agreed that
XIM is deprecated. Users should be using QT_IM_MODULE to load input context
plugin for a more advance input method framework support.
The proposed solution is to parse the compose file directly from Qt and
for fallback use a hard-coded table. This approach removes the overhead of
communication protocols used in Xlib and/or IBUS.

in linux mint case when I was trying to figure why dead keys didn't work I tried starting ibus-daemon which wasn't installed and installing it didn't help.

In my case I don't mind bundling both of them openshoot seems to bundle both also.

@MarkusLutz63
Copy link

MarkusLutz63 commented Jun 1, 2017

Cf. also https://musescore.org/en/node/196071 and https://musescore.org/en/node/104816
On my laptop (fujitsu lifebook with linuxmint xfce 18.1) even the exporting of LD_LIBRARY_PATH=$HOME/Qt5.8.0/5.8/gcc_64/lib won't help dead keys working for MuseScore-2.1-x86_64.AppImage (If I compile MuseScore on my own with QtCreator, this will work without problems).
btw - to change the input system to ibus doesn't improve anything.

@probonopd
Copy link
Owner

@ericfont https://musescore.org/en/node/216231 may be related?

@MarkusLutz63
Copy link

Possible, but I'm not sure about it. Is there already a solution for it?

@probonopd
Copy link
Owner

probonopd commented Jun 6, 2017

Need advice from someone who knows Qt well enough to determine what needs to be done.

@probonopd probonopd reopened this Jun 6, 2017
@probonopd
Copy link
Owner

Are platforminputcontexts documented somewhere, with information about which ones one needs in which situation?

@Skycoder42
Copy link
Contributor

I am not an expert, but as far as I understand, Qt loads all the plugins it can, and determines which to use based on the system setup. Typically, if you install the Qt from your distro, they are supplied as needed. Since AppImage tries to work everywhere, you should simply bundle all of them. They aren't very big, so it should be fine.

Regarding the documentation: The QPA part is kind of private API, and thus not really documented. You could try to get support directly from Qt, if you want to be shure.

@probonopd
Copy link
Owner

AppImage tries to bundle only the minimal subset of Qt needed to run one particular application. This is why we can make an AppImage of a simple QtQuick app in 12 MB. So we need to find a deterministic way to decide in which circumstances platforminputcontexts (and which of them) need to be bundled, e.g. "all of them if libQt5Gui.so is needed by the application".

@Skycoder42
Copy link
Contributor

all of them if libQt5Gui.so is needed by the application

Is probably a good approach. You could try either https://bugreports.qt.io or http://lists.qt-project.org/mailman/listinfo to get more details

@probonopd
Copy link
Owner

probonopd commented Nov 10, 2017

platforminputcontexts/libibusplatforminputcontextplugin.so may be needed for Chinese input (to be verified).

After copying file platforminputcontexts/libibusplatforminputcontextplugin.so to the plugins directory, I can make sure that the qt program can run and input chinese in any other ubuntu16.04 machine without qt installed.

Source:
https://forums.docker.com/t/cannot-input-chinese-in-docker-qt-program/39673

@probonopd
Copy link
Owner

I can confirm that without platforminputcontexts it is not possible to enter the caret ^ character in the Quassel AppImage on Ubuntu 17.10, but with it, it works:

https://github.com/probonopd/quassel/blob/773227a2accc9c282defdef5841c5db06c42ef6d/.travis.yml#L27-L28

Conclusion: We should probably bundle platforminputcontexts whenever we bundle libQt5Gui...

@probonopd
Copy link
Owner

Everyone who had issues with this, please retry with the latest continuous builds. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants