标签:
有 GitHub 账号的,可以从 https://github.com/YoungZHU/sublime-imfix.git 获取。
在(~)目录下 vi sublime-imfix.c #include <gtk/gtkimcontext.h> void gtk_im_context_set_client_window (GtkIMContext *context, GdkWindow *window) { GtkIMContextClass *klass; g_return_if_fail (GTK_IS_IM_CONTEXT (context)); klass = GTK_IM_CONTEXT_GET_CLASS (context); if (klass->set_client_window) klass->set_client_window (context, window); g_object_set_data(G_OBJECT(context),"window",window); if(!GDK_IS_WINDOW (window)) return; int width = gdk_window_get_width(window); int height = gdk_window_get_height(window); if(width != 0 && height !=0) gtk_im_context_focus_in(context); }
终端下输入如下命令:
sudo apt-get install build-essential libgtk2.0-dev
cd ~ gcc -shared -o libsublime-imfix.so sublime_imfix.c `pkg-config --libs --cflags gtk+-2.0` -fPIC
sudo mv libsublime-imfix.so /opt/sublime_text/
cd /opt/sublime_text/ LD_PRELOAD=./libsublime-imfix.so ./sublime_text
配置完成就OK了
ubuntu 14.04 sublime text3 中文无法输入的问题解决方案
标签:
原文地址:http://my.oschina.net/chinacaptain/blog/477159