gitk: restore wm state to normal before saving geometry information pt/restore-state-patch
authorAlexey Borzenkov <snaury@gmail.com>
Tue, 8 Sep 2009 19:22:36 +0000 (23:22 +0400)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Mon, 14 Sep 2009 22:14:53 +0000 (23:14 +0100)
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>
gitk

diff --git a/gitk b/gitk
index 1306178069f280412432c7e3d3bf3406135de4e5..bc31887aa16c62f6755f055c5e65da47c7c9d675 100755 (executable)
--- 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]\""