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

Re: [PATCH] gitk: don't save the geometry to rc file on exit

From
Mark Levedahl <mlevedahl@gmail.com>
Date
Mar 7, 2008, 03:03 UTC
Message-ID
<47D0B098.9040707@gmail.com>
In-Reply-To
<18383.57540.26282.526111@cargo.ozlabs.ibm.com>
Paul Mackerras wrote:
Show 32 quoted lines
> Here's a patch for people to test.  It only restores the width and
> height, and limits the width and height to be at most the width and
> height of the screen.  It seems to work fine under X; I would be
> interested to know what happens under macos and windows.
>
> Paul.
> ---
> diff --git a/gitk b/gitk
> index f1f21e9..f8f006f 100755
> --- a/gitk
> +++ b/gitk
> @@ -930,9 +930,17 @@ proc makewindow {} {
>      .pwbottom add .bright
>      .ctop add .pwbottom
>  
> -    # restore window position if known
> +    # restore window width & height if known
>      if {[info exists geometry(main)]} {
> -        wm geometry . "$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"
> +	}
>      }
>  
>      if {[tk windowingsystem] eq {aqua}} {
>   

This works fine on Cygwin: the size restores properly across sessions, the window and widgets all behave as expected. So, you can add a "Tested-by: Mark Levedahl <mlevedahl@gmail.com" if you wish to this.

Mark
Previous: Paul MackerrasNext: martin f krafft
Message 14 of 26 in “Bug in gitk - can post the window off screen”
  1. Tommy ThornFeb 7, 2008
  2. Shawn O. PearceFeb 7, 2008
  3. Robin RosenbergFeb 7, 2008
  4. Gerrit PapeFeb 7, 2008
  5. gitk: don't save the geometry to rc file on exitGerrit Pape, Feb 23, 2008
  6. Robin RosenbergFeb 23, 2008
  7. Jonathan del StrotherFeb 23, 2008
  8. Paul MackerrasFeb 23, 2008
  9. Mark LevedahlFeb 24, 2008
  10. Edgar ToernigFeb 24, 2008
  11. Paul MackerrasMar 6, 2008
  12. Jonathan del StrotherMar 6, 2008
  13. Paul MackerrasMar 6, 2008
  14. Mark LevedahlMar 7, 2008
  15. martin f krafftMar 7, 2008
  16. Paul MackerrasMar 8, 2008
  17. martin f krafftMar 10, 2008
  18. David TweedMar 10, 2008
  19. martin f krafftFeb 25, 2008
  20. Paul MackerrasFeb 25, 2008
  21. martin f krafftFeb 25, 2008
  22. Mark LevedahlFeb 25, 2008
  23. martin f krafftFeb 25, 2008
  24. Martin LanghoffFeb 25, 2008
  25. Robin RosenbergFeb 25, 2008
  26. A Large Angry SCMFeb 26, 2008

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.