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

Qt5 im-module 在 (k)ubuntu 16.04 中無法使用 #558

Open
fweng322 opened this issue Nov 13, 2016 · 6 comments
Open

Qt5 im-module 在 (k)ubuntu 16.04 中無法使用 #558

fweng322 opened this issue Nov 13, 2016 · 6 comments

Comments

@fweng322
Copy link
Contributor

原先是安裝 ubuntu 中預設的 hime / hime-qt5-immodule 但是在 qt5 的程式中一直無法呼叫 hime 出來。

後來我用 docker 建一個乾淨的 ubuntu 環境,直接編譯最新的 git 版本,在 configure 中確定有加入 --enable-qt5-immodule 並使用裡面的 distro/debian/gen_deb 建立新的 deb 套件。結果還是一樣 -- Qt5 的程式 (如 konsole)都無法呼叫出 hime。但其他的可以(像我現在是用 chromium 發這則 issue 就可以輸入)

我的做法:
Dockerfile 如下:

FROM ubuntu:latest
MAINTAINER Franklin Weng
RUN sed -i 's/archive.ubuntu.com/free.nchc.org.tw/g' /etc/apt/sources.list
RUN apt-get update && apt-get install -y vim vim-runtime gcc build-essential git
 pkg-config libxtst-dev libxtst6 libgtk-3-dev libgtk2.0-dev libqt5core5a libqt4-
dev qt4-dev-tools qt5-default libanthy-dev libchewing3-dev libappindicator3-dev 
qtbase5-dev qtbase5-private-dev qtbase5-dev-tools ssh 

進去以後用 git clone https://github.com/hime-ime/hime.git

在 configure 把除了 qt3 以外的都打開
建出來的 deb 檔在 ftp://goodhorse.idv.tw/hime_0.9.10+git20161113-1_amd64.deb

使用 im-config 選擇 hime,並修改 /usr/share/im-config/data/25_hime.rc 中加入 QT5_IM_MODULE=hime
我的環境變數:

env | grep IM

CLUTTER_IM_MODULE=xim
QT_IM_MODULE=compose
QT5_IM_MODULE=hime
QT4_IM_MODULE=hime
XDG_RUNTIME_DIR=/run/user/1000
GTK_IM_MODULE=hime

[franklin@ezgo13 ~]$ env | grep XMOD
XMODIFIERS=@im=hime
hime-env 的結果:

====Detecting hime install====
==>Hime binary found.

==>/usr/bin/hime: version 0.9.10 (git 3f52703), linked to /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 
==>/usr/share/doc/hime/changelog.Debian.gz: hime (0.9.10+git20161113-1) experimental; urgency=low


====Detecting OS/Distribution====
Linux 4.4.0-47-generic #68-Ubuntu SMP Wed Oct 26 19:39:52 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Distributor ID: Ubuntu
Description:    Ubuntu 16.04.1 LTS
Release:        16.04
Codename:       xenial
/etc/debian_version: stretch/sid
/etc/lsb-release: DISTRIB_ID=Ubuntu DISTRIB_RELEASE=16.04 DISTRIB_CODENAME=xenial DISTRIB_DESCRIPTION="Ubuntu 16.04.1 LTS"
/etc/os-release: NAME="Ubuntu" VERSION="16.04.1 LTS (Xenial Xerus)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 16.04.1 LTS" VERSION_ID="16.04" HOME_URL="http://www.ubuntu.com/" SUPPORT_URL="http://help.ubuntu.com/" BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/" VERSION_CODENAME=xenial UBUNTU_CODENAME=xenial

/etc/issue: Ubuntu 16.04.1 LTS 


====Detecting Environment Variables====

XMODIFIERS   : XMODIFIERS=@im=hime
LANG               : LANG=zh_TW.UTF-8
LANGUAGE       : LANGUAGE=zh_TW
LANG          : zh_TW.UTF-8
LANGUAGE              : zh_TW
GTK_IM_MODULE: GTK_IM_MODULE=hime
QT_IM_MODULE : QT_IM_MODULE=compose
QT4_IM_MODULE: QT4_IM_MODULE=hime


====Detecting hime status====
==>Running hime number: 1

==>hime socket number: 1

==>System library path: /lib  /lib64  /usr/lib
====Immodule status====

==>gtk-2.0 immodule cache
/usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules.cache:
/usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules/im-hime.so

==>gtk-3.0 immodule cache
/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules.cache:
/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules/im-hime.so


Vdragon added a commit to Vdragon/hime that referenced this issue Dec 20, 2016
@Vdragon
Copy link
Contributor

Vdragon commented Dec 20, 2016

Hi, please try if this works
Nope, it doesn't work.
Working on another patch

Vdragon added a commit to Vdragon/hime that referenced this issue Dec 20, 2016
@Vdragon
Copy link
Contributor

Vdragon commented Dec 20, 2016

@fweng322 Please try the patch
It seems that Qt5 uses QT_IM_MODULE variable instead

Vdragon added a commit to Vdragon/hime that referenced this issue Jan 9, 2017
目前 Debian 提供的 HIME im-config 設定程式並沒有設定 Qt5 應用軟體支援所需要的 QT_IM_MODULE
環境變數,所以使用者沒辦法在 Qt5 應用軟體中正常使用 HIME

這個修訂新增了 HIME 上游專屬的 im-config 設定(名稱與 Debian 提供的不衝突)

雖然理論上這應在 Debian 端修正,但是既然我們有放 im-switch 的資料似乎沒道理不能放 im-config 的資料

Signed-off-by: V字龍 <[email protected]>
@Vdragon
Copy link
Contributor

Vdragon commented Jan 9, 2017

我不小心放錯 im-config 資料的路徑了,現在的 PR 已修正

@Vdragon
Copy link
Contributor

Vdragon commented Jan 9, 2017

另外理論上 Debian/Ubuntu 端都要開 bug 修 im-config 的 rc 檔

@Vdragon
Copy link
Contributor

Vdragon commented Jan 9, 2017

@Vdragon
Copy link
Contributor

Vdragon commented Jan 9, 2017

Debian 已於 2016/12/7 修正問題
collab-maint/im-config - Input method configuration framework

xatier added a commit that referenced this issue Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants