Page 1 of 2

[SOLVED] Can't activate the SCIM on Firefox under CentOS 4.9

Posted: 2011/06/02 13:58:52
by machinariumer
Hi, guys
Recently I have installed the SCIM on my CentOS 4.9. I could use SCIM with gedit, terminal etc, except the Firefox 3.6.17. I presses the Ctrl + Space, SCIM haven't shown.
After spending a couple of hours on googling, I knew Firefox was a gtk application and SCIM couldn't support the GTK application so well. But I have not found a complete
solution under CentOS 4. So how to fix it ? Any ideas will be appreciated. Thanks in advance.

Best Regards

JFHU

Re: Can't activate the SCIM on Firefox under CentOS 4.9

Posted: 2011/06/02 15:37:18
by scottro
No idea if this will work, don't have a 4.x install to test but you can try


XMODIFIERS=@'im=SCIM' GTK_IM_MODULE="scim" LC_CTYPE=en_US.UTF-8 firefox &

and see if that works.

(If that doesn't work, try en_US.UTF8 or en_US.utf8)

Re: Can't activate the SCIM on Firefox under CentOS 4.9

Posted: 2011/06/03 01:37:46
by machinariumer
[quote]
scottro wrote:
No idea if this will work, don't have a 4.x install to test but you can try


XMODIFIERS=@'im=SCIM' GTK_IM_MODULE="scim" LC_CTYPE=en_US.UTF-8 firefox &

and see if that works.

(If that doesn't work, try en_US.UTF8 or en_US.utf8)[/quote]
Thanks scottro. I tried, but it still doesn't work. Also I tried en_US.UTF8 and en_US.utf8. It didn't work either.
I have seen a post that said someone could configure the firefox use the fcitx and other applications use the scim. But I don't know how to do it.

[SOLVED] Can't activate the SCIM on Firefox under CentOS 4.9

Posted: 2011/06/03 04:18:36
by toracat
Is that supposed to be this?:

XMODIFIERS="@im=SCIM"

Also try:

LC_CTYPE=ja_JP.UTF-8

Re: Can't activate the SCIM on Firefox under CentOS 4.9

Posted: 2011/06/03 04:53:28
by machinariumer
[quote]
toracat wrote:
Is that supposed to be this?:

XMODIFIERS="@im=SCIM"

Also try:

LC_CTYPE=ja_JP.UTF-8[/quote]
Thanks toracat. Oh, actually I have used XMODIFIERS="@im=SCIM". Why change the LC_CTYPE to ja_JP.UTF-8? I tried set LC_CTYPE=zh_CN.UTF-8, still failed to work. I just don't know the cause of the problem.

Re: Can't activate the SCIM on Firefox under CentOS 4.9

Posted: 2011/06/03 05:44:29
by machinariumer
OK. Now I figured out a solution. I edited the startup script of the firefox(/usr/bin/firefox). I added line [code]export GTK_IM_MODULE=xim[/code] after #! /bin/sh. Caution, It is xim, not scim. Then I can use SCIM with firefox perfectly. But I just don't know why. Maybe I should read some material about XIM and SCIM. If I know the reason, I will let you guys know. :-D

Re: Can't activate the SCIM on Firefox under CentOS 4.9

Posted: 2011/06/03 05:54:42
by toracat
LC_CTYPE=ja_JP.UTF-8 is probably not necessary (I used to have it on my system long time ago -- some Fedora days).

OK, I will share my super secret :-o Try this one:

GTK_IM_MODULE=xim

You can add environment variables to /usr/bin/firefox for convenience.

[EDIT: I see you found the solution while I was editing this post :-) ]

Re: Can't activate the SCIM on Firefox under CentOS 4.9

Posted: 2011/06/03 08:51:49
by machinariumer
[quote]
toracat wrote:
LC_CTYPE=ja_JP.UTF-8 is probably not necessary (I used to have it on my system long time ago -- some Fedora days).

OK, I will share my super secret :-o Try this one:

GTK_IM_MODULE=xim

You can add environment variables to /usr/bin/firefox for convenience.

[EDIT: I see you found the solution while I was editing this post :-) ][/quote]
:-D Thank you very much. But do you know the reason?

Re: Can't activate the SCIM on Firefox under CentOS 4.9

Posted: 2011/06/03 12:06:55
by machinariumer
OK. Now is my understanding.
With the setting GTK_IM_MODULE=scim, then Firefox(GTK+ 2.0 based application) will use the GTK IM Module the scim provides , however the GTK IM Module of scim is not compatible with Firefox, so when pressing Ctrl + Space, the scim won't show up. When set GTK_IM_MODULE equal xim, then GTK+2. 0 based application will use the XIM protocol to communicate with the XIM Server(SCIM in this case), and it works absolutely. Hope make myself clear and the above explanation is correct and it will help someone who come across the similar problems.


Best Wishes

Jfhu :-D

Re: Can't activate the SCIM on Firefox under CentOS 4.9

Posted: 2011/06/03 16:15:44
by toracat
Thanks for posting not only a solution but also detailed explanation. I found the =xim line by digging through my old firefox files but totally forgot about it because I no longer need it on CentOS-5.

I will mark this thread [SOLVED] for posterity.