aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2025-10-17 18:37:52 +0200
committerJohannes Sixt <j6t@kdbg.org>2025-10-17 18:37:52 +0200
commit8b5636a57ff078ac368f246f813b156552a0726c (patch)
tree14253f585a961459774fe0788e195b089dfb6a8c
parentac8fec7d8de265e56441713faaf4e08f11c31469 (diff)
downloadgit-8b5636a57ff078ac368f246f813b156552a0726c.tar.gz
Revert "gitk: Only restore window size from ~/.gitk, not position"
This reverts commit b9bee11526ec (gitk: Only restore window size from ~/.gitk, not position, 2008-03-10). The earlier commit e9937d2a03a4 (Make gitk work reasonably well on Cygwin, 2007-02-01) reworked the window layout considerably. Much of this became irrelevant around 2011 after Cygwin gained an X11 server and switched to a supportable port of the Unix/X11 Tcl/Tk (it is now on the current 8.6 code base). Part of the necessary change was to restore the window size across sessions, but the position was also restored. This raised complaints on the mailing list[*], because Gitk was opened on the wrong monitor. b9bee11526ec was the compromise, because it was only the size that mattered for the Cygwin layout engine to work. I personally, find it annoying when Gitk pops up on a random location on the screen, in particular, since many other applications restore the window positions across sessions, so why not Gitk as well? (I do not operate multi-monitor setups, so I cannot test the case.) [*] https://lore.kernel.org/git/47AAA254.2020008@thorn.ws/ Helped-by: Mark Levedahl <mlevedahl@gmail.com> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
-rwxr-xr-xgitk12
1 files changed, 2 insertions, 10 deletions
diff --git a/gitk b/gitk
index 6e4d71d585..275f353811 100755
--- a/gitk
+++ b/gitk
@@ -2764,17 +2764,9 @@ proc makewindow {} {
.pwbottom add .bright
.ctop add .pwbottom
- # restore window width & height if known
+ # restore window position if known
if {[info exists geometry(main)]} {
- if {[scan $geometry(main) "%dx%d" w h] >= 2} {
- if {$w > [winfo screenwidth .]} {
- set w [winfo screenwidth .]
- }
- if {$h > [winfo screenheight .]} {
- set h [winfo screenheight .]
- }
- wm geometry . "${w}x$h"
- }
+ wm geometry . "$geometry(main)"
}
if {[info exists geometry(state)] && $geometry(state) eq "zoomed"} {