git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Levedahl <mlevedahl@gmail.com>
To: Paul Mackerras <paulus@samba.org>
Cc: Gerrit Pape <pape@smarden.org>, git@vger.kernel.org
Subject: Re: [PATCH] gitk: don't save the geometry to rc file on exit
Date: Thu, 06 Mar 2008 22:03:52 -0500	[thread overview]
Message-ID: <47D0B098.9040707@gmail.com> (raw)
In-Reply-To: <18383.57540.26282.526111@cargo.ozlabs.ibm.com>

Paul Mackerras wrote:
> 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

  parent reply	other threads:[~2008-03-07  3:04 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-07  6:16 Bug in gitk - can post the window off screen Tommy Thorn
2008-02-07  6:30 ` Shawn O. Pearce
2008-02-07  9:56   ` Robin Rosenberg
2008-02-07 10:10     ` Gerrit Pape
2008-02-23 11:37       ` [PATCH] gitk: don't save the geometry to rc file on exit Gerrit Pape
2008-02-23 12:52         ` Robin Rosenberg
2008-02-23 13:15           ` Jonathan del Strother
2008-02-23 22:49         ` Paul Mackerras
2008-02-24 15:44           ` Mark Levedahl
2008-02-24 18:21             ` Edgar Toernig
2008-03-06 12:17             ` Paul Mackerras
2008-03-06 12:59               ` Jonathan del Strother
2008-03-06 23:10                 ` Paul Mackerras
2008-03-07  3:03               ` Mark Levedahl [this message]
2008-03-07 11:11               ` martin f krafft
2008-03-08 11:11                 ` Paul Mackerras
2008-03-10 11:29                   ` martin f krafft
2008-03-10 13:17                   ` David Tweed
2008-02-25  8:07           ` martin f krafft
2008-02-25 12:09             ` Paul Mackerras
2008-02-25 12:24               ` martin f krafft
2008-02-25 13:35               ` Mark Levedahl
2008-02-25 14:15                 ` martin f krafft
2008-02-25 19:59                 ` Martin Langhoff
2008-02-25 23:08                   ` Robin Rosenberg
2008-02-26  2:15           ` A Large Angry SCM

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=47D0B098.9040707@gmail.com \
    --to=mlevedahl@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=pape@smarden.org \
    --cc=paulus@samba.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).