From a7ac05641db057f58fe1d735fb6c5b7f9b99dee0 Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Mon, 10 Aug 2015 22:51:46 +0200 Subject: [PATCH] Fix composed characters when broadcast is turned on to appear in all receivers now (LP:#1463704) --- terminator | 6 ++++++ terminatorlib/terminal.py | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/terminator b/terminator index 3427398a..875a31fd 100755 --- a/terminator +++ b/terminator @@ -53,6 +53,12 @@ if __name__ == '__main__': # Not used in the 0.2x versions of VTE and can cause unwanted chars in console. if os.environ.has_key('VTE_VERSION'): del os.environ['VTE_VERSION'] + + # Workaround for IBus intefering with broadcast when using dead keys + # Environment also needs IBUS_DISABLE_SNOOPER=1, or double chars appear + # in the receivers. + os.environ['IBUS_DISABLE_SNOOPER']='1' + dbus_service = None dbg ("%s starting up, version %s" % (APP_NAME, APP_VERSION)) diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index 4f1df6c9..2d89724a 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -844,6 +844,13 @@ class Terminal(gtk.VBox): dbg('Terminal::on_keypress: Called on %s with no event' % widget) return(False) + # Workaround for IBus intefering with broadcast when using dead keys + # Environment also needs IBUS_DISABLE_SNOOPER=1, or double chars appear + # in the receivers. + if (event.state | gtk.gdk.MODIFIER_MASK ) ^ gtk.gdk.MODIFIER_MASK != 0: + dbg('Terminal::on_keypress: Ingore processed event with event.state %d' % event.state) + return(False) + # FIXME: Does keybindings really want to live in Terminator()? mapping = self.terminator.keybindings.lookup(event)