git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Pat Thoyts <patthoyts@users.sourceforge.net>
To: git@vger.kernel.org
Cc: Alexy Borzenkov <snaury@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Subject: [PATCH 2/2] Fix the geometry when restoring from zoomed state.
Date: Tue, 15 Sep 2009 10:37:51 +0100	[thread overview]
Message-ID: <8763bkcsxb.fsf@users.sourceforge.net> (raw)
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

  parent reply	other threads:[~2009-09-15 12:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-08 19:22 [PATCH] gitk: restore wm state to normal before saving geometry information Alexey Borzenkov
2009-09-15  9:26 ` [PATCH 1/2] Work around leftover temporary save file Pat Thoyts
2009-09-15 13:01   ` Alex Riesen
2009-09-15 14:14     ` Alexey Borzenkov
2009-09-15 15:44       ` Pat Thoyts
2009-09-15 14:47     ` Pat Thoyts
2009-09-15  9:37 ` Pat Thoyts [this message]
2009-09-15 14:11   ` [PATCH 2/2] Fix the geometry when restoring from zoomed state Alexey Borzenkov
2009-09-17 12:15   ` [PATCH 2/2] gitk: " Paul Mackerras
2009-09-17 13:04     ` Alexey Borzenkov
2009-09-18 13:24     ` Pat Thoyts
2009-09-15 12:03 ` [PATCH] gitk: restore wm state to normal before saving geometry information Pat Thoyts
2009-09-15 12:54   ` Alexey Borzenkov
2009-09-15 13:58     ` Alexey Borzenkov
2009-09-16 10:21 ` Paul Mackerras
2009-09-16 21:07   ` Pat Thoyts

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8763bkcsxb.fsf@users.sourceforge.net \
    --to=patthoyts@users.sourceforge.net \
    --cc=git@vger.kernel.org \
    --cc=snaury@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).