* [PATCH] git-gui: make sure placement of panedwindow sashes happens correctly on startup
@ 2010-05-01 18:29 Adam Spiers
2010-05-02 19:00 ` [msysGit] " Johannes Sixt
0 siblings, 1 reply; 2+ messages in thread
From: Adam Spiers @ 2010-05-01 18:29 UTC (permalink / raw)
To: Pat Thoyts; +Cc: git, Shawn O. Pearce, msysgit
On 20 December 2009 01:46, Pat Thoyts <patthoyts@users.sourceforge.net> wrote:
> This patch enables the use of themed Tk widgets with Tk 8.5 and above.
> These make a significant difference on Windows in making the application
> appear native. The gui.usettk git config variable may be set to disable
> this if the user prefers the classic Tk look.
> On Windows and MacOSX ttk defaults to the native look as much as possible.
> On X11 the user may select a theme using the TkTheme XRDB resource class.
> Some support is included for Tk 8.6 features (themed spinbox and native
> font chooser for MacOSX and Windows).
For me this broke persistence of the panedwindow's vertical sash
positioning in between invocations of git-gui. Upon further
investigation and discussion with helpful #git inhabitants, it
transpired that setting gui.usettk to false is a workaround, but that
the position of panedwindow's *horizontal* sash which sits in between
the panes for unstaged and staged files *never* persisted, regardless
of gui.usettk, and even going back to old 1.6.x versions.
I looked at this a bit closer, and the code seems to be doing exactly
the right thing, but it seems to be some weird kind of Tk timing
issue. I found that the below trivial patch fixes it completely, but
then I'm completely ignorant when it comes to Tk, so it may not be the
right fix.
Thanks,
Adam
P.S. This is my first patch submission via git - after poring over the
man pages and a lengthy discussion on #git, I still couldn't find a
way to send it which satisfied all of the following:
(a) formatted as a single mail, with the context and discussion
first, then the patch at the end,
(b) no MIME, and
(c) can be piped to `git am' without including the whole
mail body in the commit log.
Hopefully this is the best compromise, since everything up to the end
of this sentence can be trimmed before piping to `git am'; if not
please let me know any better alternative for future reference.
>From 3a6ce310f8b3d1e45f7a8d7ac15af7c360847ee4 Mon Sep 17 00:00:00 2001
From: Adam Spiers <git@adamspiers.org>
Date: Sat, 1 May 2010 17:15:18 +0100
Subject: [PATCH] git-gui: make sure placement of panedwindow sashes happens correctly on startup
---
git-gui.sh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/git-gui.sh b/git-gui.sh
index 8996d2d..9585d7f 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -3466,6 +3466,7 @@ $main_status show [mc "Initializing..."]
catch {
set gm $repo_config(gui.geometry)
wm geometry . [lindex $gm 0]
+update
if {$use_ttk} {
.vpane sashpos 0 [lindex $gm 1]
.vpane.files sashpos 0 [lindex $gm 2]
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [msysGit] [PATCH] git-gui: make sure placement of panedwindow sashes happens correctly on startup
2010-05-01 18:29 [PATCH] git-gui: make sure placement of panedwindow sashes happens correctly on startup Adam Spiers
@ 2010-05-02 19:00 ` Johannes Sixt
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Sixt @ 2010-05-02 19:00 UTC (permalink / raw)
To: Adam Spiers; +Cc: Pat Thoyts, git, Shawn O. Pearce, msysgit
Am 01.05.2010 20:29, schrieb Adam Spiers:
> diff --git a/git-gui.sh b/git-gui.sh
> index 8996d2d..9585d7f 100755
> --- a/git-gui.sh
> +++ b/git-gui.sh
> @@ -3466,6 +3466,7 @@ $main_status show [mc "Initializing..."]
> catch {
> set gm $repo_config(gui.geometry)
> wm geometry . [lindex $gm 0]
> +update
> if {$use_ttk} {
> .vpane sashpos 0 [lindex $gm 1]
> .vpane.files sashpos 0 [lindex $gm 2]
This flashes git-gui briefly with the default size before it resizes to
the final size on startup. Not that it matters a lot, because the
incorrect sash position is much more annoying than this flashing.
But I do wonder why gitk does not have the same problem with its sashes...
-- Hannes
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-05-02 19:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-01 18:29 [PATCH] git-gui: make sure placement of panedwindow sashes happens correctly on startup Adam Spiers
2010-05-02 19:00 ` [msysGit] " Johannes Sixt
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).