From d388885581513e504aad64cff624f45eda440ba9 Mon Sep 17 00:00:00 2001 From: Thomas Hurst Date: Fri, 29 Aug 2008 19:23:30 +0100 Subject: [PATCH] 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. --- terminatorlib/terminator.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/terminatorlib/terminator.py b/terminatorlib/terminator.py index 1060d7a4..06f3d875 100755 --- a/terminatorlib/terminator.py +++ b/terminatorlib/terminator.py @@ -250,6 +250,8 @@ class Terminator: dbg("Saving session for xsm") args = [sys.argv[0], ("--geometry=%dx%d" % self.window.get_size()) + ("+%d+%d" % self.window.get_position())] + + # OptionParser should really help us out here drop_next_arg = False geompatt = re.compile(r'^--geometry(=.+)?') for arg in sys.argv[1:]: @@ -257,10 +259,16 @@ class Terminator: if mo: if not mo.group(1): 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) 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 # --sm-foo-bar arguments before our own argument list. *mutter* # So, hopefully your #! line is correct. If not, we could write out