All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org, Mark Levedahl <mdl123@verizon.net>
Subject: Re: [PATCH] Make gitk save and restore the user set window position.
Date: Wed, 7 Feb 2007 00:40:10 -0500	[thread overview]
Message-ID: <20070207054010.GB7047@spearce.org> (raw)
In-Reply-To: <7v3b5ifyam.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano <junkio@cox.net> wrote:
>    After seeing what this patch has to do, I feel dirty, but
>    that is not Mark's fault -- rather it is Tk's.
> 
>    I am tempted to suggest adding an explicit "Save window
>    configuration" action on the menubar and forget about
>    resurrecting the window configuration immediately before the
>    end of the last session.

Maybe take a look at what git-gui does here, because its slightly
saner and still saves the geometry on exit:

	set is_quitting 0
	proc do_quit {} {
		global is_quitting
		if {$is_quitting} return
		set is_quitting 1
		# save wm geometry
	}
	bind . <Destroy> do_quit

OK, its not that much saner.  But it does bypass needing to setup
some ugly bindings on every object in the UI.  Though I recently
took a slightly different approach in a dialog:

	proc do_quit {} {
		bind . <Destroy> {}
		# do cleanup
	}
	bind . <Destroy> do_quit

Yes the binding is firing in both cases for some arbitrary child
widget in the window, but it doesn't matter.  In the latter version
setting the binding to the empty string removes the do_quit binding,
allowing the other widgets to destroy without reinvoking do_quit
and whacking whatever geometry data you may have saved before the
widgets started to get deleted.


The only problem I seem to have in git-gui is the window position
opens about 10 pixels lower and 2 pixels to the right than the last
time it opened.  I think there's a bug in Tk on Windows where the
window position on the desktop doesn't include the titlebar when I
get it, but expects to include it when I attempt to set it on the
next start.

I should note I also see the same behavior with my day-time-job's
Java apps on Windows however, so I don't think its a specific Tk
or git-gui issue.

-- 
Shawn.

  reply	other threads:[~2007-02-07  5:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-07  3:21 [PATCH] Make gitk save and restore the user set window position Junio C Hamano
2007-02-07  5:40 ` Shawn O. Pearce [this message]
2007-02-08  0:30   ` Mark Levedahl
2007-02-08  5:43 Brett Schwarz
2007-02-08 16:55 ` Mark Levedahl
2007-02-11 14:27 Mark Levedahl
2007-02-11 14:27 ` Mark Levedahl
2007-02-11 21:49 ` Junio C Hamano

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=20070207054010.GB7047@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=mdl123@verizon.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.