Re: update ibus to 1.5.1 / shell extension for IBus 1.4

Fuminobu TAKEYAMA <[email protected]>
Newsgroups gmane.linux.suse.m17n
Message-ID <[email protected]>
Hello, it's 4 a.m. in Japan,

I updated my shell extension. It should work fine with ibus on *RC1 DVD*.
On 12.3 repo, there is ibus with hillwood's patch, which does not work
with my extension because the patch removes code for the indicator.
https://github.com/ftake/ibus_indicator-14

To test this, please run
$ cd ~/.local/share/gnome-shell/extensions/
$ git clone git://github.com/ftake/ibus_indicator-14.git

and enable it by gnome-tweak-tool

> Now, you need to change the default settings for gnome-shell.
>
> See enabled-extensions key in
> https://build.opensuse.org/package/view_file?expand=1&file=glib2-branding.gschema.override.in&package=glib2-branding-openSUSE&project=GNOME%3AFactory
Thanks!

Now, I have five ideas:
1. Go with the current (hillwood's patched) ibus
   - Its icon is managed notification daemon (on the bottom of *Activity*)
   - A bit difficult to use (too small menu, not shown always)
2. Enable the extension by modifying glib2-branding-openSUSE
3. Put a part of the extension (only 17 lines of code) into gnome-shell's script
    by a patch (see below)
   - This *was* the best solution if we could notice this problem earlier beta
4. Users enable the extension manually by gnome-tweak-tool, and we update
    hillwood's patch to work with the extension


5. Call "gnome-shell-extension-tools -e ibus_indicator-14" from
    the ibus launch script to enable the extension

Fuminobu TAKEYAMA


geeko@linux-jpk4:~> diff -u /usr/share/gnome-shell/js/ui/notificationDaemon.js.back 
/usr/share/gnome-shell/js/ui/notificationDaemon.js
--- /usr/share/gnome-shell/js/ui/notificationDaemon.js.back	2013-02-13 03:55:29.996264488 
+0900
+++ /usr/share/gnome-shell/js/ui/notificationDaemon.js	2013-02-13 04:19:39.961930850 +0900
@@ -500,6 +500,21 @@

      _onTrayIconAdded: function(o, icon) {
          let wmClass = icon.wm_class ? icon.wm_class.toLowerCase() : '';
+	if (wmClass == 'ibus-ui-gtk') {
+	    try {
+		var IBus = imports.gi.IBus
+		if (!('new_async' in IBus.Bus)) {
+		    // This IBus does not support GNOME 3.6
+		    icon.height = imports.ui.panel.PANEL_ICON_SIZE
+		    this.ibusIndicator = new imports.ui.panelMenu.Button()
+		    this.ibusIndicator.actor.add_actor(icon)
+		    Main.panel.addToStatusArea('ibus-gtk-ui', this.ibusIndicator, 0, 'right')
+		}
+	    } catch(e) {
+		IBus = null
+	    }
+	}
+
          if (STANDARD_TRAY_ICON_IMPLEMENTATIONS[wmClass] !== undefined)
              return;

@@ -510,6 +525,8 @@
          let source = this._lookupSource(null, icon.pid, true);
          if (source)
              source.destroy();
+	if (icon.wm_class == 'ibus-ui-gtk' && this.ibusIndicator)
+	    this.ibusIndicator.destroy();
      }
  });
-- 
To unsubscribe, e-mail: [email protected]
To contact the owner, e-mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.