From 06c88b85acfee0c74859be84c097c4aaa7720e45 Mon Sep 17 00:00:00 2001 From: Pat Thoyts Date: Tue, 15 Sep 2009 10:37:51 +0100 Subject: [PATCH] gitk: Fix the geometry when restoring from zoomed state. The patch to handle the geometry of a restored gitk by Alexy Borzenkov causes the position of the columns to creep each time the application is restarted. This patch addresses this by remembering the application geometry for the normal state and saving that regardless of the actual state when the application is closed. Signed-off-by: Pat Thoyts --- gitk | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gitk b/gitk index 1f36a3e..7a17cd3 100755 --- a/gitk +++ b/gitk @@ -2335,6 +2335,8 @@ proc makewindow {} { } wm geometry . "${w}x$h" } + } else { + set geometry(main) [wm geometry .] } if {[info exists geometry(state)] && $geometry(state) eq "zoomed"} { @@ -2360,6 +2362,12 @@ proc makewindow {} { } } + bind . { + if {[winfo toplevel %W] eq "%W" && [wm state %W] eq "normal"} { + set ::geometry(main) %wx%h+%x+%y + } + } + bind .pwbottom {resizecdetpanes %W %w} pack .ctop -fill both -expand 1 bindall <1> {selcanvline %W %x %y} @@ -2658,7 +2666,7 @@ 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(main) $::geometry(main)" puts $f "set geometry(state) [wm state .]" puts $f "set geometry(topwidth) [winfo width .tf]" puts $f "set geometry(topheight) [winfo height .tf]" -- 2.23.0