From 8ec9001b506bed8f55249c54ec59e9fe0cea7959 Mon Sep 17 00:00:00 2001 From: Dominic Hopf Date: Oct 14 2015 19:46:37 +0000 Subject: apply patch from upstream for fixing RHBZ#1268289 and add dependency to python-psutils Patch by Marco Driusso, thanks! --- diff --git a/0001-terminator-fix-RHBZ#1268289.patch b/0001-terminator-fix-RHBZ#1268289.patch new file mode 100644 index 0000000..7abae79 --- /dev/null +++ b/0001-terminator-fix-RHBZ#1268289.patch @@ -0,0 +1,127 @@ +diff -Naur a/ChangeLog b/ChangeLog +--- a/ChangeLog 2015-09-08 17:27:00.000000000 +0200 ++++ b/ChangeLog 2015-10-10 11:55:37.000000000 +0200 +@@ -1,3 +1,11 @@ ++terminator trunk: ++ * Features ++ * Enhancements ++ * Bug fixes ++ * Fix for those not running IBus, where the IBus workaround caused ++ broken keys in other keymaps set with non-IBus tools (Steve ++ Boddy, LP#1494606) ++ + terminator 0.98: + * Features + * Layout launcher with option or shortcut (Steve Boddy) +diff -Naur a/debian/changelog b/debian/changelog +--- a/debian/changelog 2015-09-08 17:27:00.000000000 +0200 ++++ b/debian/changelog 2015-10-10 11:55:37.000000000 +0200 +@@ -1,3 +1,9 @@ ++terminator (0.98) trusty; urgency=low ++ ++ * New upstream release of 0.98 ++ ++ -- Stephen Boddy Wed, 26 Aug 2015 20:28:10 +0200 ++ + terminator (0.97~ppa3) saucy; urgency=low + + * No-change upload for saucy +diff -Naur a/debian/control b/debian/control +--- a/debian/control 2015-09-08 17:27:00.000000000 +0200 ++++ b/debian/control 2015-10-10 11:55:37.000000000 +0200 +@@ -14,7 +14,7 @@ + + Package: terminator + Architecture: all +-Depends: ${python:Depends}, ${misc:Depends}, python-vte, python-gobject, python-gtk2 (>= 2.14.0), gconf2, libgtk2.0-bin, hicolor-icon-theme ++Depends: ${python:Depends}, ${misc:Depends}, python-vte, python-gobject, python-gtk2 (>= 2.14.0), python-psutil, gconf2, libgtk2.0-bin, hicolor-icon-theme + XB-Python-Version: ${python:Versions} + Provides: x-terminal-emulator + Recommends: xdg-utils, python-gnome2, python-keybinder +diff -Naur a/remotinator b/remotinator +--- a/remotinator 2015-09-08 17:27:00.000000000 +0200 ++++ b/remotinator 2015-10-10 11:55:37.000000000 +0200 +@@ -29,7 +29,7 @@ + sys.exit(1) + + APP_NAME='remotinator' +-APP_VERSION='0.97' ++APP_VERSION='0.98' + + COMMANDS={ + 'hsplit': ['terminal_hsplit', 'Split the current terminal horizontally'], +diff -Naur a/terminator b/terminator +--- a/terminator 2015-09-08 17:27:00.000000000 +0200 ++++ b/terminator 2015-10-10 11:55:37.000000000 +0200 +@@ -20,6 +20,8 @@ + + import sys + import os ++import psutil ++import pwd + try: + ORIGCWD = os.getcwd() + except OSError: +@@ -57,7 +59,11 @@ + # 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' ++ username = pwd.getpwuid(os.getuid()).pw_name ++ ibus_running = [p for p in psutil.process_iter() if p.name == 'ibus-daemon' and p.username == username] ++ ibus_running = len(ibus_running) > 0 ++ if ibus_running: ++ os.environ['IBUS_DISABLE_SNOOPER']='1' + + dbus_service = None + +@@ -69,7 +75,6 @@ + # launch gui, return selection + LAYOUTLAUNCHER=LayoutLauncher() + else: +- + # Attempt to import our dbus server. If one exists already we will just + # connect to that and ask for a new window. If not, we will create one and + # continue. Failure to import dbus, or the global config option "dbus" +@@ -112,6 +117,7 @@ + TERMINATOR.set_origcwd(ORIGCWD) + TERMINATOR.set_dbus_data(dbus_service) + TERMINATOR.reconfigure() ++ TERMINATOR.ibus_running = ibus_running + + try: + dbg('Creating a terminal with layout: %s' % OPTIONS.layout) +diff -Naur a/terminatorlib/terminal.py b/terminatorlib/terminal.py +--- a/terminatorlib/terminal.py 2015-09-08 17:27:00.000000000 +0200 ++++ b/terminatorlib/terminal.py 2015-10-10 11:55:37.000000000 +0200 +@@ -844,13 +844,14 @@ + dbg('Terminal::on_keypress: Called on %s with no event' % widget) + return(False) + +- # Workaround for IBus intefering with broadcast when using dead keys ++ # Workaround for IBus interfering 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) +- ++ if self.terminator.ibus_running: ++ if (event.state | gtk.gdk.MODIFIER_MASK ) ^ gtk.gdk.MODIFIER_MASK != 0: ++ dbg('Terminal::on_keypress: Ignore 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) + +diff -Naur a/terminatorlib/terminator.py b/terminatorlib/terminator.py +--- a/terminatorlib/terminator.py 2015-09-08 17:27:00.000000000 +0200 ++++ b/terminatorlib/terminator.py 2015-10-10 11:55:37.000000000 +0200 +@@ -32,6 +32,7 @@ + pid_cwd = None + gnome_client = None + debug_address = None ++ ibus_running = None + + doing_layout = None + layoutname = None diff --git a/terminator.spec b/terminator.spec index 7468fb8..546ae26 100644 --- a/terminator.spec +++ b/terminator.spec @@ -2,7 +2,7 @@ Name: terminator Version: 0.98 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Store and run multiple GNOME terminals in one window Group: User Interface/Desktops @@ -10,11 +10,14 @@ License: GPLv2 URL: http://gnometerminator.blogspot.com/p/introduction.html Source0: http://code.launchpad.net/terminator/trunk/%{version}/+download/%{name}-%{version}.tar.gz Patch0: 0000-terminator-fix-desktop-file.patch +# Upstream patch for LP#1494606 obtained as diff between v0.98 and r1647 +# of branch lp:terminator, excluding *.po files. Fixes RHBZ#1268289 +Patch1: 0001-terminator-fix-RHBZ#1268289.patch BuildArch: noarch BuildRequires: python-devel gettext desktop-file-utils intltool Requires: vte gnome-python2-gconf GConf2 gtk2 desktop-file-utils -Requires: gnome-python2-bonobo python-keybinder +Requires: gnome-python2-bonobo python-keybinder python-psutil %description @@ -28,7 +31,8 @@ arrangements of terminals for different tasks. %prep %setup -q sed -i '/#! \?\/usr.*/d' terminatorlib/*.py -%patch0 +%patch0 +%patch1 -p1 %build @@ -50,7 +54,7 @@ rm -rf %{buildroot} %files -f %{name}.lang %defattr(-,root,root) -%doc README COPYING ChangeLog +%doc README COPYING ChangeLog %{_datadir}/doc/%{name}/* %{_mandir}/man1/%{name}.* %{_mandir}/man5/%{name}_config.* @@ -78,7 +82,11 @@ gtk-update-icon-cache -qf %{_datadir}/icons/hicolor &>/dev/null || : %changelog -* Tue Sep 08 2015 Dominic Hopf - 0.98-1 +* Sat Oct 10 2015 Marco Driusso - 0.98-2 +- apply patch from upstream for fixing RHBZ#1268289 and add dependency to + python-psutils + +* Tue Sep 08 2015 Dominic Hopf - 0.98-1 - New Upstream Release: Terminator 0.98 * Thu Jun 25 2015 Dominic Hopf - 0.97-8