{"thread":{"id":"6789","subject":"[PATCH] Make gitk save and restore window pane position on Linux and Cygwin.","startedAt":"2007-02-13T00:19:34Z","lastAt":"2007-02-13T17:45:11Z","messageCount":4,"participants":["Mark Levedahl","Junio C Hamano","Sergey Vlasov"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"34345","messageId":"11713259742627-git-send-email-mdl123@verizon.net","threadId":"6789","inReplyTo":null,"subject":"[PATCH] Make gitk save and restore window pane position on Linux and Cygwin.","fromName":"Mark Levedahl","fromEmail":"mdl123@verizon.net","sentAt":"2007-02-13T00:19:34Z","receivedAt":"2007-02-13T00:19:34Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Subtle bugs remained on both Cygwin and Linux that caused the various\nwindow panes to be restored in positions different than where the user\nlast placed them. Sergey Vlasov posed a pair of suggested fixes to this,\nwhat is done here is slightly different. The basic fix here involves\na) explicitly remembering and restoring the sash positions for the upper\nwindow, and b) using paneconfigure to redundantly set height and width of\nother elements. This redundancy is needed as Cygwin Tcl has a nasty habit\nof setting pane sizes to zero if their slaves are not configured with a\nspecific size, but Linux Tcl does not honor the specific size given.\n\nSigned-off-by: Mark Levedahl <mdl123@verizon.net>\n---\n gitk |   23 +++++++++++++----------\n 1 files changed, 13 insertions(+), 10 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex df1ce8c..9ddff3e 100755\n--- a/gitk\n+++ b/gitk\n@@ -439,14 +439,13 @@ proc makewindow {} {\n     panedwindow .ctop -orient vertical\n \n     # possibly use assumed geometry\n-    if {![info exists geometry(topheight)]} {\n+    if {![info exists geometry(pwsash0)]} {\n         set geometry(topheight) [expr {15 * $linespc}]\n         set geometry(topwidth) [expr {80 * $charspc}]\n         set geometry(botheight) [expr {15 * $linespc}]\n         set geometry(botwidth) [expr {50 * $charspc}]\n-        set geometry(canv) [expr {40 * $charspc}]\n-        set geometry(canv2) [expr {20 * $charspc}]\n-        set geometry(canv3) [expr {20 * $charspc}]\n+        set geometry(pwsash0) \"[expr {40 * $charspc}] 2\"\n+        set geometry(pwsash1) \"[expr {60 * $charspc}] 2\"\n     }\n \n     # the upper half will have a paned window, a scroll bar to the right, and some stuff below\n@@ -457,18 +456,20 @@ proc makewindow {} {\n     # create three canvases\n     set cscroll .tf.histframe.csb\n     set canv .tf.histframe.pwclist.canv\n-    canvas $canv -width $geometry(canv) \\\n+    canvas $canv \\\n \t-background $bgcolor -bd 0 \\\n \t-yscrollincr $linespc -yscrollcommand \"scrollcanv $cscroll\"\n     .tf.histframe.pwclist add $canv\n     set canv2 .tf.histframe.pwclist.canv2\n-    canvas $canv2 -width $geometry(canv2) \\\n+    canvas $canv2 \\\n \t-background $bgcolor -bd 0 -yscrollincr $linespc\n     .tf.histframe.pwclist add $canv2\n     set canv3 .tf.histframe.pwclist.canv3\n-    canvas $canv3 -width $geometry(canv3) \\\n+    canvas $canv3 \\\n \t-background $bgcolor -bd 0 -yscrollincr $linespc\n     .tf.histframe.pwclist add $canv3\n+    eval .tf.histframe.pwclist sash place 0 $geometry(pwsash0)\n+    eval .tf.histframe.pwclist sash place 1 $geometry(pwsash1)\n \n     # a scroll bar to rule them\n     scrollbar $cscroll -command {allcanvs yview} -highlightthickness 0\n@@ -577,6 +578,8 @@ proc makewindow {} {\n     pack .tf.bar -in .tf -side bottom -fill x\n     pack .tf.histframe -fill both -side top -expand 1\n     .ctop add .tf\n+    .ctop paneconfigure .tf -height $geometry(topheight)\n+    .ctop paneconfigure .tf -width $geometry(topwidth)\n \n     # now build up the bottom\n     panedwindow .pwbottom -orient horizontal\n@@ -638,6 +641,7 @@ proc makewindow {} {\n     $ctext tag conf found -back yellow\n \n     .pwbottom add .bleft\n+    .pwbottom paneconfigure .bleft -width $geometry(botwidth)\n \n     # lower right\n     frame .bright\n@@ -832,9 +836,8 @@ proc savestuff {w} {\n \tputs $f \"set geometry(main) [wm geometry .]\"\n \tputs $f \"set geometry(topwidth) [winfo width .tf]\"\n \tputs $f \"set geometry(topheight) [winfo height .tf]\"\n-\tputs $f \"set geometry(canv) [winfo width $canv]\"\n-\tputs $f \"set geometry(canv2) [winfo width $canv2]\"\n-\tputs $f \"set geometry(canv3) [winfo width $canv3]\"\n+        puts $f \"set geometry(pwsash0) \\\"[.tf.histframe.pwclist sash coord 0]\\\"\"\n+        puts $f \"set geometry(pwsash1) \\\"[.tf.histframe.pwclist sash coord 1]\\\"\"\n \tputs $f \"set geometry(botwidth) [winfo width .bleft]\"\n \tputs $f \"set geometry(botheight) [winfo height .bleft]\"\n \n-- \n1.5.0.rc3.24.g0c5e\n"},{"id":"34354","messageId":"7vbqjy7t86.fsf@assigned-by-dhcp.cox.net","threadId":"6789","inReplyTo":"11713259742627-git-send-email-mdl123@verizon.net","subject":"Re: [PATCH] Make gitk save and restore window pane position on Linux and Cygwin.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-13T01:15:53Z","receivedAt":"2007-02-13T01:15:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This looks sane to me, although a bit twisted (and again it is\nnot Mark's fault).  Sergey, Ack?\n"},{"id":"34396","messageId":"20070213111037.GM23550@master.mivlgu.local","threadId":"6789","inReplyTo":"7vbqjy7t86.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Make gitk save and restore window pane position on Linux and Cygwin.","fromName":"Sergey Vlasov","fromEmail":"vsu@altlinux.ru","sentAt":"2007-02-13T11:10:37Z","receivedAt":"2007-02-13T11:10:37Z","isPatch":true,"sender":{"key":"vsu@altlinux.ru","avatar":"https://avatars.githubusercontent.com/u/616082?v=4"},"body":"On Mon, Feb 12, 2007 at 05:15:53PM -0800, Junio C Hamano wrote:\n> This looks sane to me, although a bit twisted (and again it is\n> not Mark's fault).  Sergey, Ack?\n\nYes, current git (85b1f988) works for me.\n"},{"id":"34435","messageId":"7vps8ex87s.fsf@assigned-by-dhcp.cox.net","threadId":"6789","inReplyTo":"20070213111037.GM23550@master.mivlgu.local","subject":"Re: [PATCH] Make gitk save and restore window pane position on Linux and Cygwin.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-13T17:45:11Z","receivedAt":"2007-02-13T17:45:11Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sergey Vlasov <vsu@altlinux.ru> writes:\n\n> On Mon, Feb 12, 2007 at 05:15:53PM -0800, Junio C Hamano wrote:\n>> This looks sane to me, although a bit twisted (and again it is\n>> not Mark's fault).  Sergey, Ack?\n>\n> Yes, current git (85b1f988) works for me.\n\nThanks, both.\n"}]}