# [PATCH] gitk: restore wm state to normal before saving geometry information

1 messages from 2009-09-08 to 2009-09-08. Participants: Alexey Borzenkov.
Thread: https://gitlist.dev/t/20881

## Alexey Borzenkov, 2009-09-08 18:44

Subject: [PATCH] gitk: restore wm state to normal before saving geometry information
Message-ID: <e2480c70909081144m7bd936fawfade280488cb0680@mail.gmail.com>
URL: https://gitlist.dev/e/e2480c70909081144m7bd936fawfade280488cb0680%40mail.gmail.com

```
gitk now includes patches for saving and restoring wm state, however
because it saves wm geometry when window can still be maximized the
maximize/restore button becomes useless after restarting gitk (you
will get a huge displaced window if you try to restore it). This
patch fixes this issue by storing window geometry in normal state.

Signed-off-by: Alexey Borzenkov <snaury@gmail.com>
---
 Please don't forget to cc me if you have comments/questions

 gitk |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/gitk b/gitk
index 8c08310..fedeb88 100755
--- a/gitk
+++ b/gitk
@@ -2555,8 +2555,11 @@ proc savestuff {w} {
 	puts $f [list set extdifftool $extdifftool]
 	puts $f [list set perfile_attrs $perfile_attrs]

-	puts $f "set geometry(main) [wm geometry .]"
 	puts $f "set geometry(state) [wm state .]"
+	if {[wm state .] eq {zoomed}} {
+		wm state . normal
+	}
+	puts $f "set geometry(main) [wm geometry .]"
 	puts $f "set geometry(topwidth) [winfo width .tf]"
 	puts $f "set geometry(topheight) [winfo height .tf]"
         puts $f "set geometry(pwsash0) \"[.tf.histframe.pwclist sash
coord 0]\""
-- 
1.6.4.2

```
