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

Re: [PATCH v3 1/2] Revert "gitk: Only restore window size from ~/.gitk, not position"

From
Johannes Sixt <j6t@kdbg.org>
Date
Oct 17, 2025, 16:36 UTC
Message-ID
<fd4437c2-ca62-4221-b426-f3c3dc3d2a47@kdbg.org>
In-Reply-To
<be1e6cba-c94d-4c2f-ab68-e368ffe9daa5@gmail.com>
Am 28.09.25 um 16:17 schrieb Mark Levedahl:
Show 52 quoted lines
> On 9/28/25 9:54 AM, Michael Rappazzo wrote:
>> From: Johannes Sixt <johannes.sixt@telecom.at>
>>
>> This reverts commit b9bee11526ec23541ddbbd75716bfd1acc241463.
>>
>> The commit catered to an unsupportable port of the Windows Tcl/Tk
>> stuck at 8.4.1 that was used by Cygwin. 8.4.1 has some bad bugs in its
>> layout engine, and forced changes in Gitk to be compatible. All 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).
>>
>> Helped-by: Mark Levedahl <mlevedahl@gmail.com>
>> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
>> ---
>>  gitk | 12 ++----------
>>  1 file 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"} {
> I mis-interpreted an earlier inquiry about the patch being reverted here. Patch e9937d2a03
> actually addressed the issues of Cygwin's 8.4.1 Tcl/Tk. Part of that was fixing the window
> geometry being restored, as sometimes the window manager would size the main window in a
> manner causing 8.4.1 to fail. But, this override of the main window manager on all
> platforms raised complaints on the mailing list, and commit b9bee11526 was the response:
> it was only the SIZE of the Window that mattered on Cygwin, not its location, so allowing
> window managers to set the location was ok.
> 
> Personally, I'm fine with gitk remembering / restoring the full window geometry (I wrote
> it that way in e9937d2a03).

Thank you for the hint. I found the thread, and after reading it I notice that the opposition is based on that restoring the position doesn't put the window on the desired monitor. I can't test this right now. I've rewritten the commit message as follows. Whether or not the position should be restored seems to be a personal preference, and the patch applies my and your preference, but obviously not everyone's. Please let me know whether I understood the situation correctly or not.

    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/
-- Hannes
Previous: Mike RappazzoNext: Mark Levedahl
Message 5 of 12 in “gitk: make Tags and Heads window geometry sticky”
  1. 0/2 gitk: make Tags and Heads window geometry stickyMichael Rappazzo, Sep 28, 2025
  2. 1/2 Revert "gitk: Only restore window size from ~/.gitk, not position"Michael Rappazzo, Sep 28, 2025
  3. Mark LevedahlSep 28, 2025
  4. Mike RappazzoSep 28, 2025
  5. Johannes SixtOct 17, 2025
  6. Mark LevedahlOct 17, 2025
  7. Junio C HamanoSep 28, 2025
  8. 2/2 gitk: make Tags and Heads window geometry stickyMichael Rappazzo, Sep 28, 2025
  9. Junio C HamanoSep 28, 2025
  10. Johannes SixtOct 4, 2025
  11. gitk: persist position and size of the Tags and Heads windowJohannes Sixt, Oct 4, 2025
  12. gitk: persist position and size of the Tags and Heads windowJohannes Sixt, Oct 6, 2025

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.