From ed5a4040bc17ca85ad4737dca26842520613f776 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Wed, 30 Jan 2013 13:37:14 +0000 Subject: [PATCH] Don't try to set the global hide_window keybinding if it's disabled. Closes LP#1101155 --- terminatorlib/window.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/terminatorlib/window.py b/terminatorlib/window.py index e39fa714..b5b3cc7f 100755 --- a/terminatorlib/window.py +++ b/terminatorlib/window.py @@ -117,18 +117,19 @@ class Window(Container, gtk.Window): # Attempt to grab a global hotkey for hiding the window. # If we fail, we'll never hide the window, iconifying instead. - try: - self.hidebound = keybinder.bind( - self.config['keybindings']['hide_window'], - self.on_hide_window) - except (KeyError, NameError): - pass + if self.config['keybindings']['hide_window'] != None: + try: + self.hidebound = keybinder.bind( + self.config['keybindings']['hide_window'], + self.on_hide_window) + except (KeyError, NameError): + pass - if not self.hidebound: - err('Unable to bind hide_window key, another instance/window has it.') - self.hidefunc = self.iconify - else: - self.hidefunc = self.hide + if not self.hidebound: + err('Unable to bind hide_window key, another instance/window has it.') + self.hidefunc = self.iconify + else: + self.hidefunc = self.hide def apply_config(self): """Apply various configuration options"""