only do session handling if we have a gnome_client

This commit is contained in:
Chris Jones 2008-10-16 11:43:50 +01:00
parent 19619bff98
commit b623f662e8
1 changed files with 21 additions and 19 deletions

View File

@ -104,6 +104,7 @@ class Terminator:
self.debugaddress = None self.debugaddress = None
self.start_cwd = os.getcwd() self.start_cwd = os.getcwd()
self.term_list = [] self.term_list = []
self.gnome_client = None
stores = [] stores = []
stores.append (config.TerminatorConfValuestoreRC ()) stores.append (config.TerminatorConfValuestoreRC ())
@ -272,26 +273,27 @@ class Terminator:
if self._fullscreen: if self._fullscreen:
args.append('--fullscreen') args.append('--fullscreen')
# We can't set an interpreter because Gnome unconditionally spams it with if self.gnome_client:
# --sm-foo-bar arguments before our own argument list. *mutter* # We can't set an interpreter because Gnome unconditionally spams it with
# So, hopefully your #! line is correct. If not, we could write out # --sm-foo-bar arguments before our own argument list. *mutter*
# a shell script with the interpreter name etc. # So, hopefully your #! line is correct. If not, we could write out
c = self.gnome_client # a shell script with the interpreter name etc.
c.set_program(sys.argv[0]) c = self.gnome_client
dbg("Session restart command: %s with args %s in %s" % (sys.argv[0], repr(args), self.start_cwd)) c.set_program(sys.argv[0])
dbg("Session restart command: %s with args %s in %s" % (sys.argv[0], repr(args), self.start_cwd))
c.set_restart_style(gnome.ui.RESTART_IF_RUNNING) c.set_restart_style(gnome.ui.RESTART_IF_RUNNING)
c.set_current_directory(self.start_cwd) c.set_current_directory(self.start_cwd)
try: try:
c.set_restart_command(args) c.set_restart_command(args)
c.set_clone_command(args) c.set_clone_command(args)
except (TypeError,AttributeError): except (TypeError,AttributeError):
# Apparantly needed for some Fedora systems # Apparantly needed for some Fedora systems
# see http://trac.nicfit.net/mesk/ticket/137 # see http://trac.nicfit.net/mesk/ticket/137
dbg("Gnome bindings have weird set_clone/restart_command") dbg("Gnome bindings have weird set_clone/restart_command")
c.set_restart_command(len(args), args) c.set_restart_command(len(args), args)
c.set_clone_command(len(args), args) c.set_clone_command(len(args), args)
return True return True
def maximize (self): def maximize (self):
""" Maximize the Terminator window.""" """ Maximize the Terminator window."""