Implement equivalent functionality as previous iterations wrt handling the availability of the hide_window keybinding
This commit is contained in:
parent
3df46d1d85
commit
598eededd2
|
@ -26,6 +26,7 @@ class Window(Container, gtk.Window):
|
||||||
title = None
|
title = None
|
||||||
isfullscreen = None
|
isfullscreen = None
|
||||||
hidebound = None
|
hidebound = None
|
||||||
|
hidefunc = None
|
||||||
|
|
||||||
def __init__(self, configobject):
|
def __init__(self, configobject):
|
||||||
"""Class initialiser"""
|
"""Class initialiser"""
|
||||||
|
@ -45,13 +46,16 @@ class Window(Container, gtk.Window):
|
||||||
self.connect('destroy', self.on_destroy_event)
|
self.connect('destroy', self.on_destroy_event)
|
||||||
self.connect('window-state-event', self.on_window_state_changed)
|
self.connect('window-state-event', self.on_window_state_changed)
|
||||||
|
|
||||||
self.hidebound = False
|
# Attempt to grab a global hotkey for hiding the window.
|
||||||
try:
|
# If we fail, we'll never hide the window, iconifying instead.
|
||||||
self.couldbind = bindkey.tomboy_keybinder_bind(
|
self.hidebound = bindkey.tomboy_keybinder_bind(
|
||||||
self.config['keybindings']['hide_window'],
|
self.config['keybindings']['hide_window'],
|
||||||
self.on_hide_window)
|
self.on_hide_window)
|
||||||
except KeyError:
|
if not self.hidebound:
|
||||||
dbg('Unable to bind hide_window key, another instance has it.')
|
dbg('Unable to bind hide_window key, another instance has it.')
|
||||||
|
self.hidefunc = self.iconify
|
||||||
|
else:
|
||||||
|
self.hidefunc = self.hide
|
||||||
|
|
||||||
def apply_config(self):
|
def apply_config(self):
|
||||||
"""Apply various configuration options"""
|
"""Apply various configuration options"""
|
||||||
|
|
Loading…
Reference in New Issue