git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] Fix the geometry when restoring from zoomed state.

From
Pat Thoyts <patthoyts@users.sourceforge.net>
Date
Sep 15, 2009, 09:37 UTC
Message-ID
<8763bkcsxb.fsf@users.sourceforge.net>
In-Reply-To
<1252437756-81986-1-git-send-email-snaury@gmail.com>

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 <patthoyts@users.sourceforge.net>
---
 gitk |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/gitk b/gitk
index a0214b7..67122c3 100755
--- a/gitk
+++ b/gitk
@@ -2251,6 +2251,8 @@ proc makewindow {} {
 	    }
 	    wm geometry . "${w}x$h"
 	}
+    } else {
+	set geometry(main) [wm geometry .]
     }
 
     if {[info exists geometry(state)] && $geometry(state) eq "zoomed"} {
@@ -2265,6 +2267,11 @@ proc makewindow {} {
         set ::BM "2"
     }
 
+    bind . <Configure> {
+	if {[winfo toplevel %W] eq "%W" && [wm state %W] eq "normal"} {
+	    set ::geometry(main) %wx%h+%x+%y
+	}
+    }
     bind .pwbottom <Configure> {resizecdetpanes %W %w}
     pack .ctop -fill both -expand 1
     bindall <1> {selcanvline %W %x %y}
@@ -2556,7 +2563,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]"
-- 
1.6.4.msysgit.0
Previous: Pat ThoytsNext: Alexey Borzenkov
Message 7 of 16 in “gitk: restore wm state to normal before saving geometry information”
  1. gitk: restore wm state to normal before saving geometry informationAlexey Borzenkov, Sep 8, 2009
  2. 1/2 Work around leftover temporary save file.Pat Thoyts, Sep 15, 2009
  3. Alex RiesenSep 15, 2009
  4. Alexey BorzenkovSep 15, 2009
  5. Pat ThoytsSep 15, 2009
  6. Pat ThoytsSep 15, 2009
  7. 2/2 Fix the geometry when restoring from zoomed state.Pat Thoyts, Sep 15, 2009
  8. Alexey BorzenkovSep 15, 2009
  9. Paul MackerrasSep 17, 2009
  10. Alexey BorzenkovSep 17, 2009
  11. Pat ThoytsSep 18, 2009
  12. Pat ThoytsSep 15, 2009
  13. Alexey BorzenkovSep 15, 2009
  14. Alexey BorzenkovSep 15, 2009
  15. Paul MackerrasSep 16, 2009
  16. Pat ThoytsSep 16, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.