From: "Jonathan del Strother" <maillist@steelskies.com>
To: "Paul Mackerras" <paulus@samba.org>
Cc: "Mark Levedahl" <mlevedahl@gmail.com>,
"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, 6 Mar 2008 12:59:24 +0000 [thread overview]
Message-ID: <57518fd10803060459m6e3ffc00n388721ad2e5975ad@mail.gmail.com> (raw)
In-Reply-To: <18383.57540.26282.526111@cargo.ozlabs.ibm.com>
On Thu, Mar 6, 2008 at 12:17 PM, Paul Mackerras <paulus@samba.org> wrote:
> Mark Levedahl writes:
>
> > I can only offer to test the proposed patch, I am unable to predict what
> > will or won't trip up the buggy geometry engine in Cygwin's Tk. I do
> > remember I had trouble finding a way to restore the size but not the
> > position of the main window on Cygwin: that doesn't mean it can't be
> > done (logically, it should be easy), just that I didn't find the right
> > spell or incantation that would work. I'll also admit to not having
> > tried after I got to a completely working geometry solution, so perhaps
> > just restoring the size without position will now work on Cygwin.
> >
> > Using the saved panel sizes in conjunction with the default window size
> > yields an unusable screen: many elements are obscured. The same occurs
> > using the defaults altogether: either way the user must resize and
> > adjust things to get to a workable layout. So, I am very opposed to
> > disabling the memory altogether. Also, I have a number of X apps that
> > remember their layout, so gitk's current behavior is not (at least to
> > me) an aberration and I would like that behavior to at least remain an
> > option.
>
> 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 almost works on OS X. The only problem is that it's not taking
into account menubars and windowbars. eg, if I have a screen
resolution of 640x480, setting the window _content_ to that size will
make the entire window including its titlebar about 500px tall. Not
only that, but the system-wide menubar at the top of the screen also
reduces the available space, meaning that the maximum window size
ought to be around 640x456. (If you wanted to get even pickier, that
will changing depending on the interface resolution...)
Presumably your patch does nothing to move gitk back on screen if the
monitor it was on last time has gone away? Or are we still blaming
the window manager for that?
next prev parent reply other threads:[~2008-03-06 13:00 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 [this message]
2008-03-06 23:10 ` Paul Mackerras
2008-03-07 3:03 ` Mark Levedahl
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=57518fd10803060459m6e3ffc00n388721ad2e5975ad@mail.gmail.com \
--to=maillist@steelskies.com \
--cc=git@vger.kernel.org \
--cc=mlevedahl@gmail.com \
--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).