linuxmint ibus 輸入法無法顯示輸入法圖示

Linux Mint 12 安裝筆記 – iBus 系統匣輸入法圖示顯示問題排除
裝好Linux Mint跟iBus 後發現切換輸入法時iBus的系統匣顯示的是禁止符號的圖示,我使用的解決方法是在 /usr/share/ibus/ui/gtk/panel.py這個檔案中加入下面+號後兩行的程式碼(因為是Python語法所以要注意程式碼前的空格數):

    def state_changed(self):
        if not self.__focus_ic:
            return

        enabled = self.__focus_ic.is_enabled()
        self.__language_bar.set_enabled(enabled)

        if enabled == False:
            self.reset()
            self.__set_im_icon(ICON_KEYBOARD)
            self.__set_im_name(None)
        else:
            engine = self.__focus_ic.get_engine()
            if engine:
+               pixbuf = gdk.pixbuf_new_from_file(engine.icon)
+               gtk.icon_theme_add_builtin_icon(engine.icon, 0, pixbuf)
                self.__set_im_icon(engine.icon)
                self.__set_im_name(engine.longname)
            else:
                self.__set_im_icon(ICON_KEYBOARD)
                self.__set_im_name(None)

這樣系統匣的輸入法圖示就可以正常顯示了

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

Google+ photo

You are commenting using your Google+ account. Log Out / 變更 )

連結到 %s