{"thread":{"id":"57447","subject":"[PATCH 0/2] gitk: include y coord in recorded sash position","startedAt":"2022-02-20T19:47:44Z","lastAt":"2022-02-20T19:47:47Z","messageCount":3,"participants":["Halil Sen via GitGitGadget","halilsen via GitGitGadget"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"448917","messageId":"pull.1219.git.git.1645386457.gitgitgadget@gmail.com","threadId":"57447","inReplyTo":null,"subject":"[PATCH 0/2] gitk: include y coord in recorded sash position","fromName":"Halil Sen via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2022-02-20T19:47:34Z","receivedAt":"2022-02-20T19:47:44Z","isPatch":true,"sender":{"key":"name:Halil Sen","avatar":null},"body":"This PR fixes the issue reported by Anders Kaseorg in 1\n[https://public-inbox.org/git/1f6e179c-d9c3-e503-3218-0acf4ff27cca@mit.edu/].\n\n6cd80496e9 (\"gitk: Resize panes correctly when reducing window size\",\n2020-10-03) introduces a mechanism to record previously-set sash positions\nto make sure that correct values are used while computing resize\nproportions.\n\nHowever, if we are not using ttk, then sash represents only the x coordinate\nand the recorded sash (oldsash) only includes the x coordinate. When we need\nto access the y coordinate via the recorded sash position, we generate the\nfollowing Application Error popup:\n\n    Error: expected integer but got \"\"\n    \n    expected integer but got \"\"\n    \n    expected integer but got \"\"\n    \n         while executing\n    \n    \"$win sash place 0 $sash0 [lindex $s0 1]\"\n    \n         (procedure \"resizeclistpanes\" line 38)\n    \n         invoked from within\n    \n    \"resizeclistpanes .tf.histframe.pwclist 2818\"\n    \n         (command bound to event)\n\n\nTo fix this, if we are not using ttk, we append the sash positions with the\ny coordinates before recording them to match the use_ttk case.\n\nhalilsen (2):\n  gitk: trivial indentation fix\n  gitk: include y coord in recorded sash position\n\n gitk-git/gitk | 17 ++++++++++-------\n 1 file changed, 10 insertions(+), 7 deletions(-)\n\n\nbase-commit: e6ebfd0e8cbbd10878070c8a356b5ad1b3ca464e\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1219%2Fsenhalil%2Fmaster-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1219/senhalil/master-v1\nPull-Request: https://github.com/git/git/pull/1219\n-- \ngitgitgadget\n"},{"id":"448918","messageId":"49abba78f45b34484982532de970c0659ee6535c.1645386457.git.gitgitgadget@gmail.com","threadId":"57447","inReplyTo":"pull.1219.git.git.1645386457.gitgitgadget@gmail.com","subject":"[PATCH 1/2] gitk: trivial indentation fix","fromName":"halilsen via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2022-02-20T19:47:35Z","receivedAt":"2022-02-20T19:47:45Z","isPatch":true,"sender":{"key":"name:halilsen","avatar":null},"body":"From: halilsen <halil.sen@mapotempo.com>\n\nNo functional changes.\n\nSigned-off-by: Halil Sen <halil.sen@gmail.com>\n---\n gitk-git/gitk | 14 +++++++-------\n 1 file changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex 23d9dd1fe0d..c31a8b4e2f8 100755\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -2955,9 +2955,9 @@ proc savestuff {w} {\n proc resizeclistpanes {win w} {\n     global oldwidth oldsash use_ttk\n     if {[info exists oldwidth($win)]} {\n-\tif {[info exists oldsash($win)]} {\n-\t    set s0 [lindex $oldsash($win) 0]\n-\t    set s1 [lindex $oldsash($win) 1]\n+        if {[info exists oldsash($win)]} {\n+            set s0 [lindex $oldsash($win) 0]\n+            set s1 [lindex $oldsash($win) 1]\n         } elseif {$use_ttk} {\n             set s0 [$win sashpos 0]\n             set s1 [$win sashpos 1]\n@@ -2992,7 +2992,7 @@ proc resizeclistpanes {win w} {\n             $win sash place 0 $sash0 [lindex $s0 1]\n             $win sash place 1 $sash1 [lindex $s1 1]\n         }\n-\tset oldsash($win) [list $sash0 $sash1]\n+        set oldsash($win) [list $sash0 $sash1]\n     }\n     set oldwidth($win) $w\n }\n@@ -3000,8 +3000,8 @@ proc resizeclistpanes {win w} {\n proc resizecdetpanes {win w} {\n     global oldwidth oldsash use_ttk\n     if {[info exists oldwidth($win)]} {\n-\tif {[info exists oldsash($win)]} {\n-\t    set s0 $oldsash($win)\n+        if {[info exists oldsash($win)]} {\n+            set s0 $oldsash($win)\n         } elseif {$use_ttk} {\n             set s0 [$win sashpos 0]\n         } else {\n@@ -3024,7 +3024,7 @@ proc resizecdetpanes {win w} {\n         } else {\n             $win sash place 0 $sash0 [lindex $s0 1]\n         }\n-\tset oldsash($win) $sash0\n+        set oldsash($win) $sash0\n     }\n     set oldwidth($win) $w\n }\n-- \ngitgitgadget\n\n"},{"id":"448919","messageId":"0b5b8fb591e434a2a24b1f58d1ce3fc7da48a28e.1645386457.git.gitgitgadget@gmail.com","threadId":"57447","inReplyTo":"pull.1219.git.git.1645386457.gitgitgadget@gmail.com","subject":"[PATCH 2/2] gitk: include y coord in recorded sash position","fromName":"halilsen via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2022-02-20T19:47:36Z","receivedAt":"2022-02-20T19:47:47Z","isPatch":true,"sender":{"key":"name:halilsen","avatar":null},"body":"From: halilsen <halil.sen@mapotempo.com>\n\n6cd80496e9 (\"gitk: Resize panes correctly when reducing window size\",\n2020-10-03) introduces a mechanism to record previously-set sash\npositions to make sure that correct values are used while computing\nresize proportions. However, if we are not using ttk, then sash\nrepresents only the x coordinate and the recorded sash (`oldsash`) only\nincludes the x coordinate. When we need to access the y coordinate via\nthe recorded sash position, we generate the following Application Error\npopup:\n\nError: expected integer but got \"\"\n\nexpected integer but got \"\"\n\nexpected integer but got \"\"\n\n     while executing\n\n\"$win sash place 0 $sash0 [lindex $s0 1]\"\n\n     (procedure \"resizeclistpanes\" line 38)\n\n     invoked from within\n\n\"resizeclistpanes .tf.histframe.pwclist 2818\"\n\n     (command bound to event)\n\nTo fix this, if we are not using ttk, we append the sash positions with\nthe y coordinates before recording them to match the use_ttk case.\n\nSigned-off-by: Halil Sen <halil.sen@gmail.com>\n---\n gitk-git/gitk | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex c31a8b4e2f8..0ae7d685904 100755\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -2991,6 +2991,8 @@ proc resizeclistpanes {win w} {\n         } else {\n             $win sash place 0 $sash0 [lindex $s0 1]\n             $win sash place 1 $sash1 [lindex $s1 1]\n+            set sash0 [list $sash0 [lindex $s0 1]]\n+            set sash1 [list $sash1 [lindex $s1 1]]\n         }\n         set oldsash($win) [list $sash0 $sash1]\n     }\n@@ -3023,6 +3025,7 @@ proc resizecdetpanes {win w} {\n             $win sashpos 0 $sash0\n         } else {\n             $win sash place 0 $sash0 [lindex $s0 1]\n+            set sash0 [list $sash0 [lindex $s0 1]]\n         }\n         set oldsash($win) $sash0\n     }\n-- \ngitgitgadget\n"}]}