8ec900
diff -Naur a/ChangeLog b/ChangeLog
8ec900
--- a/ChangeLog	2015-09-08 17:27:00.000000000 +0200
8ec900
+++ b/ChangeLog	2015-10-10 11:55:37.000000000 +0200
8ec900
@@ -1,3 +1,11 @@
8ec900
+terminator trunk:
8ec900
+  * Features
8ec900
+  * Enhancements
8ec900
+  * Bug fixes
8ec900
+    * Fix for those not running IBus, where the IBus workaround caused
8ec900
+      broken keys in other keymaps set with non-IBus tools (Steve
8ec900
+      Boddy, LP#1494606)
8ec900
+
8ec900
 terminator 0.98:
8ec900
   * Features
8ec900
     * Layout launcher with option or shortcut (Steve Boddy)
8ec900
diff -Naur a/debian/changelog b/debian/changelog
8ec900
--- a/debian/changelog	2015-09-08 17:27:00.000000000 +0200
8ec900
+++ b/debian/changelog	2015-10-10 11:55:37.000000000 +0200
8ec900
@@ -1,3 +1,9 @@
8ec900
+terminator (0.98) trusty; urgency=low
8ec900
+
8ec900
+  * New upstream release of 0.98
8ec900
+
8ec900
+ -- Stephen Boddy <stephen.j.boddy@gmail.com>  Wed, 26 Aug 2015 20:28:10 +0200
8ec900
+
8ec900
 terminator (0.97~ppa3) saucy; urgency=low
8ec900
 
8ec900
   * No-change upload for saucy
8ec900
diff -Naur a/debian/control b/debian/control
8ec900
--- a/debian/control	2015-09-08 17:27:00.000000000 +0200
8ec900
+++ b/debian/control	2015-10-10 11:55:37.000000000 +0200
8ec900
@@ -14,7 +14,7 @@
8ec900
 
8ec900
 Package: terminator
8ec900
 Architecture: all
8ec900
-Depends: ${python:Depends}, ${misc:Depends}, python-vte, python-gobject, python-gtk2 (>= 2.14.0), gconf2, libgtk2.0-bin, hicolor-icon-theme
8ec900
+Depends: ${python:Depends}, ${misc:Depends}, python-vte, python-gobject, python-gtk2 (>= 2.14.0), python-psutil, gconf2, libgtk2.0-bin, hicolor-icon-theme
8ec900
 XB-Python-Version: ${python:Versions}
8ec900
 Provides: x-terminal-emulator
8ec900
 Recommends: xdg-utils, python-gnome2, python-keybinder
8ec900
diff -Naur a/remotinator b/remotinator
8ec900
--- a/remotinator	2015-09-08 17:27:00.000000000 +0200
8ec900
+++ b/remotinator	2015-10-10 11:55:37.000000000 +0200
8ec900
@@ -29,7 +29,7 @@
8ec900
     sys.exit(1)
8ec900
 
8ec900
 APP_NAME='remotinator'
8ec900
-APP_VERSION='0.97'
8ec900
+APP_VERSION='0.98'
8ec900
 
8ec900
 COMMANDS={
8ec900
         'hsplit': ['terminal_hsplit', 'Split the current terminal horizontally'],
8ec900
diff -Naur a/terminator b/terminator
8ec900
--- a/terminator	2015-09-08 17:27:00.000000000 +0200
8ec900
+++ b/terminator	2015-10-10 11:55:37.000000000 +0200
8ec900
@@ -20,6 +20,8 @@
8ec900
 
8ec900
 import sys
8ec900
 import os
8ec900
+import psutil
8ec900
+import pwd
8ec900
 try:
8ec900
     ORIGCWD = os.getcwd()
8ec900
 except OSError:
8ec900
@@ -57,7 +59,11 @@
8ec900
     # Workaround for IBus intefering with broadcast when using dead keys
8ec900
     # Environment also needs IBUS_DISABLE_SNOOPER=1, or double chars appear
8ec900
     # in the receivers.
8ec900
-    os.environ['IBUS_DISABLE_SNOOPER']='1'
8ec900
+    username = pwd.getpwuid(os.getuid()).pw_name
8ec900
+    ibus_running = [p for p in psutil.process_iter() if p.name == 'ibus-daemon' and p.username == username]
8ec900
+    ibus_running = len(ibus_running) > 0
8ec900
+    if ibus_running:
8ec900
+        os.environ['IBUS_DISABLE_SNOOPER']='1'
8ec900
 
8ec900
     dbus_service = None
8ec900
 
8ec900
@@ -69,7 +75,6 @@
8ec900
         # launch gui, return selection
8ec900
         LAYOUTLAUNCHER=LayoutLauncher()
8ec900
     else:
8ec900
-        
8ec900
         # Attempt to import our dbus server. If one exists already we will just
8ec900
         # connect to that and ask for a new window. If not, we will create one and
8ec900
         # continue. Failure to import dbus, or the global config option "dbus"
8ec900
@@ -112,6 +117,7 @@
8ec900
         TERMINATOR.set_origcwd(ORIGCWD)
8ec900
         TERMINATOR.set_dbus_data(dbus_service)
8ec900
         TERMINATOR.reconfigure()
8ec900
+        TERMINATOR.ibus_running = ibus_running
8ec900
 
8ec900
         try:
8ec900
             dbg('Creating a terminal with layout: %s' % OPTIONS.layout)
8ec900
diff -Naur a/terminatorlib/terminal.py b/terminatorlib/terminal.py
8ec900
--- a/terminatorlib/terminal.py	2015-09-08 17:27:00.000000000 +0200
8ec900
+++ b/terminatorlib/terminal.py	2015-10-10 11:55:37.000000000 +0200
8ec900
@@ -844,13 +844,14 @@
8ec900
             dbg('Terminal::on_keypress: Called on %s with no event' % widget)
8ec900
             return(False)
8ec900
 
8ec900
-        # Workaround for IBus intefering with broadcast when using dead keys
8ec900
+        # Workaround for IBus interfering with broadcast when using dead keys
8ec900
         # Environment also needs IBUS_DISABLE_SNOOPER=1, or double chars appear
8ec900
         # in the receivers.
8ec900
-        if (event.state | gtk.gdk.MODIFIER_MASK ) ^ gtk.gdk.MODIFIER_MASK != 0:
8ec900
-            dbg('Terminal::on_keypress: Ingore processed event with event.state %d' % event.state)
8ec900
-            return(False)
8ec900
-
8ec900
+        if self.terminator.ibus_running:
8ec900
+            if (event.state | gtk.gdk.MODIFIER_MASK ) ^ gtk.gdk.MODIFIER_MASK != 0:
8ec900
+                dbg('Terminal::on_keypress: Ignore processed event with event.state %d' % event.state)
8ec900
+                return(False)
8ec900
+        
8ec900
         # FIXME: Does keybindings really want to live in Terminator()?
8ec900
         mapping = self.terminator.keybindings.lookup(event)
8ec900
 
8ec900
diff -Naur a/terminatorlib/terminator.py b/terminatorlib/terminator.py
8ec900
--- a/terminatorlib/terminator.py	2015-09-08 17:27:00.000000000 +0200
8ec900
+++ b/terminatorlib/terminator.py	2015-10-10 11:55:37.000000000 +0200
8ec900
@@ -32,6 +32,7 @@
8ec900
     pid_cwd = None
8ec900
     gnome_client = None
8ec900
     debug_address = None
8ec900
+    ibus_running = None
8ec900
 
8ec900
     doing_layout = None
8ec900
     layoutname = None