Save maximized and fullscreen state. Argument handling needs improving; it'll break if short-form is used and squished together.

Probably we should piece together a command line directly from OptionParser's results, not copy it manually like this.
This commit is contained in:
Thomas Hurst 2008-08-29 19:23:30 +01:00
parent 035b15b6d9
commit d388885581
1 changed files with 9 additions and 1 deletions

View File

@ -250,6 +250,8 @@ class Terminator:
dbg("Saving session for xsm") dbg("Saving session for xsm")
args = [sys.argv[0], args = [sys.argv[0],
("--geometry=%dx%d" % self.window.get_size()) + ("+%d+%d" % self.window.get_position())] ("--geometry=%dx%d" % self.window.get_size()) + ("+%d+%d" % self.window.get_position())]
# OptionParser should really help us out here
drop_next_arg = False drop_next_arg = False
geompatt = re.compile(r'^--geometry(=.+)?') geompatt = re.compile(r'^--geometry(=.+)?')
for arg in sys.argv[1:]: for arg in sys.argv[1:]:
@ -257,10 +259,16 @@ class Terminator:
if mo: if mo:
if not mo.group(1): if not mo.group(1):
drop_next_arg = True drop_next_arg = True
elif not drop_next_arg: elif not drop_next_arg and arg not in ('--maximise', '-m', '--fullscreen', '-f'):
args.append(arg) args.append(arg)
drop_next_arg = False drop_next_arg = False
if self._maximised:
args.append('--maximise')
if self._fullscreen:
args.append('--fullscreen')
# We can't set an interpreter because Gnome unconditionally spams it with # We can't set an interpreter because Gnome unconditionally spams it with
# --sm-foo-bar arguments before our own argument list. *mutter* # --sm-foo-bar arguments before our own argument list. *mutter*
# So, hopefully your #! line is correct. If not, we could write out # So, hopefully your #! line is correct. If not, we could write out