{"thread":{"id":"23661","subject":"[PATCH] git-gui: make sure placement of panedwindow sashes happens correctly on startup","startedAt":"2010-05-01T18:29:18Z","lastAt":"2010-05-02T19:00:50Z","messageCount":2,"participants":["Adam Spiers","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"140704","messageId":"20100501182918.GA19769@atlantic.linksys.moosehall","threadId":"23661","inReplyTo":null,"subject":"[PATCH] git-gui: make sure placement of panedwindow sashes happens correctly on startup","fromName":"Adam Spiers","fromEmail":"git@adamspiers.org","sentAt":"2010-05-01T18:29:18Z","receivedAt":"2010-05-01T18:29:18Z","isPatch":true,"sender":{"key":"git@adamspiers.org","avatar":"https://avatars.githubusercontent.com/u/100738?v=4"},"body":"On 20 December 2009 01:46, Pat Thoyts <patthoyts@users.sourceforge.net> wrote:\n> This patch enables the use of themed Tk widgets with Tk 8.5 and above.\n> These make a significant difference on Windows in making the application\n> appear native. The gui.usettk git config variable may be set to disable\n> this if the user prefers the classic Tk look.\n> On Windows and MacOSX ttk defaults to the native look as much as possible.\n> On X11 the user may select a theme using the TkTheme XRDB resource class.\n> Some support is included for Tk 8.6 features (themed spinbox and native\n> font chooser for MacOSX and Windows).\n\nFor me this broke persistence of the panedwindow's vertical sash\npositioning in between invocations of git-gui.  Upon further\ninvestigation and discussion with helpful #git inhabitants, it\ntranspired that setting gui.usettk to false is a workaround, but that\nthe position of panedwindow's *horizontal* sash which sits in between\nthe panes for unstaged and staged files *never* persisted, regardless\nof gui.usettk, and even going back to old 1.6.x versions.\n\nI looked at this a bit closer, and the code seems to be doing exactly\nthe right thing, but it seems to be some weird kind of Tk timing\nissue.  I found that the below trivial patch fixes it completely, but\nthen I'm completely ignorant when it comes to Tk, so it may not be the\nright fix.\n\nThanks,\nAdam\n\nP.S. This is my first patch submission via git - after poring over the\nman pages and a lengthy discussion on #git, I still couldn't find a\nway to send it which satisfied all of the following:\n\n  (a) formatted as a single mail, with the context and discussion\n      first, then the patch at the end,\n  (b) no MIME, and\n  (c) can be piped to `git am' without including the whole\n      mail body in the commit log.\n\nHopefully this is the best compromise, since everything up to the end\nof this sentence can be trimmed before piping to `git am'; if not\nplease let me know any better alternative for future reference.\n\n>From 3a6ce310f8b3d1e45f7a8d7ac15af7c360847ee4 Mon Sep 17 00:00:00 2001\nFrom: Adam Spiers <git@adamspiers.org>\nDate: Sat, 1 May 2010 17:15:18 +0100\nSubject: [PATCH] git-gui: make sure placement of panedwindow sashes happens correctly on startup\n\n---\n git-gui.sh |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/git-gui.sh b/git-gui.sh\nindex 8996d2d..9585d7f 100755\n--- a/git-gui.sh\n+++ b/git-gui.sh\n@@ -3466,6 +3466,7 @@ $main_status show [mc \"Initializing...\"]\n catch {\n set gm $repo_config(gui.geometry)\n wm geometry . [lindex $gm 0]\n+update\n if {$use_ttk} {\n \t.vpane sashpos 0 [lindex $gm 1]\n \t.vpane.files sashpos 0 [lindex $gm 2]\n-- \n1.7.1\n"},{"id":"140788","messageId":"4BDDCBE2.7040204@kdbg.org","threadId":"23661","inReplyTo":"20100501182918.GA19769@atlantic.linksys.moosehall","subject":"Re: [msysGit] [PATCH] git-gui: make sure placement of panedwindow sashes happens correctly on startup","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2010-05-02T19:00:50Z","receivedAt":"2010-05-02T19:00:50Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 01.05.2010 20:29, schrieb Adam Spiers:\n> diff --git a/git-gui.sh b/git-gui.sh\n> index 8996d2d..9585d7f 100755\n> --- a/git-gui.sh\n> +++ b/git-gui.sh\n> @@ -3466,6 +3466,7 @@ $main_status show [mc \"Initializing...\"]\n>   catch {\n>   set gm $repo_config(gui.geometry)\n>   wm geometry . [lindex $gm 0]\n> +update\n>   if {$use_ttk} {\n>   \t.vpane sashpos 0 [lindex $gm 1]\n>   \t.vpane.files sashpos 0 [lindex $gm 2]\n\nThis flashes git-gui briefly with the default size before it resizes to \nthe final size on startup. Not that it matters a lot, because the \nincorrect sash position is much more annoying than this flashing.\n\nBut I do wonder why gitk does not have the same problem with its sashes...\n\n-- Hannes\n"}]}