From: Mark Levedahl <mdl123@verizon.net>
To: git@vger.kernel.org
Cc: Mark Levedahl <mdl123@verizon.net>
Subject: [PATCH] Make gitk save and restore the user set window position.
Date: Sun, 11 Feb 2007 09:27:19 -0500 [thread overview]
Message-ID: <11712040403973-git-send-email-mdl123@verizon.net> (raw)
In-Reply-To: <11712040401127-git-send-email-mdl123@verizon.net>
gitk was saving widget sizes and positions when the main window was
destroyed, which is after all child widgets are destroyed. The cure
is to trap the WM_DELETE_WINDOW event before the gui is torn down. Also,
the saved geometry was captured using "winfo geometry .", rather than
"wm geometry ." Under Linux, these two return different answers and the
latter one is correct.
Signed-off-by: Mark Levedahl <mdl123@verizon.net>
---
gitk | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/gitk b/gitk
index 1c36235..23bf567 100755
--- a/gitk
+++ b/gitk
@@ -725,7 +725,7 @@ proc makewindow {} {
bind . <Control-KP_Add> {incrfont 1}
bind . <Control-minus> {incrfont -1}
bind . <Control-KP_Subtract> {incrfont -1}
- bind . <Destroy> {savestuff %W}
+ wm protocol . WM_DELETE_WINDOW doquit
bind . <Button-1> "click %W"
bind $fstring <Key-Return> dofind
bind $sha1entry <Key-Return> gotocommit
@@ -829,7 +829,7 @@ proc savestuff {w} {
puts $f [list set colors $colors]
puts $f [list set diffcolors $diffcolors]
- puts $f "set geometry(main) [winfo geometry .]"
+ 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(canv) [expr {[winfo width $canv]-0}]"
@@ -5800,6 +5800,7 @@ proc showtag {tag isnew} {
proc doquit {} {
global stopped
set stopped 100
+ savestuff .
destroy .
}
--
1.5.0.rc3.24.g0c5e
next prev parent reply other threads:[~2007-02-11 14:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-11 14:27 [PATCH] Make gitk save and restore the user set window position Mark Levedahl
2007-02-11 14:27 ` Mark Levedahl [this message]
2007-02-11 14:27 ` [PATCH] Clean up geometry save code in gitk Mark Levedahl
2007-02-11 16:56 ` Sergey Vlasov
2007-02-11 16:58 ` gitk: Fix restoring of pane sizes Sergey Vlasov
2007-02-11 16:58 ` gitk: Fix restoring of column widths in the commit tree Sergey Vlasov
2007-02-11 17:44 ` [PATCH] Clean up geometry save code in gitk Mark Levedahl
2007-02-11 21:49 ` [PATCH] Make gitk save and restore the user set window position Junio C Hamano
-- strict thread matches above, loose matches on Subject: below --
2007-02-08 5:43 Brett Schwarz
2007-02-08 16:55 ` Mark Levedahl
2007-02-07 3:21 Junio C Hamano
2007-02-07 5:40 ` Shawn O. Pearce
2007-02-08 0:30 ` Mark Levedahl
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11712040403973-git-send-email-mdl123@verizon.net \
--to=mdl123@verizon.net \
--cc=git@vger.kernel.org \
/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.
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 NNTP newsgroup(s).