{"thread":{"id":"56979","subject":"[PATCH] gitk: fix error when resizing gitk","startedAt":"2021-11-25T13:33:21Z","lastAt":"2022-02-23T17:24:37Z","messageCount":3,"participants":["Shulhan","Halil SEN"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"442308","messageId":"20211125125720.231039-1-ms@kilabit.info","threadId":"56979","inReplyTo":null,"subject":"[PATCH] gitk: fix error when resizing gitk","fromName":"Shulhan","fromEmail":"ms@kilabit.info","sentAt":"2021-11-25T12:57:20Z","receivedAt":"2021-11-25T13:33:21Z","isPatch":true,"sender":{"key":"ms@kilabit.info","avatar":"https://gravatar.com/avatar/7c1ee6694e3700fd875823c62aec25e00a70f36f47a217ccd9240a0f5f8cb25e?d=mp&s=160"},"body":"When using gitk run on Wayland (in this case using sway window manager)\nand the window is vertical split, trying to resize the split will thrown\nthe following error,\n\n\texpected integer but got \"\"\n\texpected integer but got \"\"\n\t    while executing\n\t\"$win sash place 0 $sash0 [lindex $s0 1]\"\n\t    (procedure \"resizeclistpanes\" line 38)\n\t    invoked from within\n\t\"resizeclistpanes .tf.histframe.pwclist 983\"\n\t    (command bound to event)\n\nThe issue is confirmed by Anders Kaseorg on the list [1].\n\nThis commit fix this issue by checking if the $s0 or $s1 is empty\nstring, if its true set it to 0.\n\nPS: I have send this patch to paulus@ozlabs.org, and it seems like there\nis no reply since 7 Oct. Either the email is not received or somethings\nin between.\n\n[1] https://public-inbox.org/git/1f6e179c-d9c3-e503-3218-0acf4ff27cca@mit.edu/\n\nSigned-off-by: Shulhan <ms@kilabit.info>\n---\n gitk-git/gitk | 12 ++++++++++--\n 1 file changed, 10 insertions(+), 2 deletions(-)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex 23d9dd1fe0..fc2add49b4 100755\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -2989,8 +2989,16 @@ proc resizeclistpanes {win w} {\n             $win sashpos 0 $sash0\n             $win sashpos 1 $sash1\n         } else {\n-            $win sash place 0 $sash0 [lindex $s0 1]\n-            $win sash place 1 $sash1 [lindex $s1 1]\n+            set p0 [lindex $s0 1]\n+            set p1 [lindex $s1 1]\n+            if {$p0 eq \"\"} {\n+                set p0 0\n+            }\n+            if {$p1 eq \"\"} {\n+                set p1 0\n+            }\n+            $win sash place 0 $sash0 $p0\n+            $win sash place 1 $sash1 $p1\n         }\n \tset oldsash($win) [list $sash0 $sash1]\n     }\n-- \n2.34.0\n\n"},{"id":"449268","messageId":"CAOeUTuuyftWB=PaA9HPDnyxsb40R3Z6GD65TB92jEW+38goqRg@mail.gmail.com","threadId":"56979","inReplyTo":"20211125125720.231039-1-ms@kilabit.info","subject":"Re: [PATCH] gitk: fix error when resizing gitk","fromName":"Halil SEN","fromEmail":"halilsen@gmail.com","sentAt":"2022-02-23T15:03:55Z","receivedAt":"2022-02-23T15:04:10Z","isPatch":true,"sender":{"key":"halilsen@gmail.com","avatar":null},"body":"Hello Shulhan,\n\nI just stumbled upon your patch while looking for the patch\nthat I sent at the beginning of this week for the exact same\nissue.  It turns out you sent your patch two months ago.  I\nshould have checked before debugging :face_palm:\n\nIf you would like to check it out, here is my patch in [1].\n\nI see that you have fixed resizeclistpanes but exact same issue\nis present on resizecdetpanes as well.\n\nI am not sure if the conditional logic is necessary because we\nare sure that `sash#` includes x, y positions in ttk mode but it\nincludes only the x position if not ttk. Also setting the y coord\nto 0 might have unintended consequences.\n\n\n[1] https://lore.kernel.org/git/0b5b8fb591e434a2a24b1f58d1ce3fc7da48a28e.1645386457.git.gitgitgadget@gmail.com/\n\nSigned-off-by: Halil Sen <halil.sen@gmail.com>\n"},{"id":"449276","messageId":"20220224001656.6bd80ed0@inspiro.localdomain","threadId":"56979","inReplyTo":"CAOeUTuuyftWB=PaA9HPDnyxsb40R3Z6GD65TB92jEW+38goqRg@mail.gmail.com","subject":"Re: [PATCH] gitk: fix error when resizing gitk","fromName":"Shulhan","fromEmail":"ms@kilabit.info","sentAt":"2022-02-23T17:16:56Z","receivedAt":"2022-02-23T17:24:37Z","isPatch":true,"sender":{"key":"ms@kilabit.info","avatar":"https://gravatar.com/avatar/7c1ee6694e3700fd875823c62aec25e00a70f36f47a217ccd9240a0f5f8cb25e?d=mp&s=160"},"body":"On Wed, 23 Feb 2022 16:03:55 +0100\nHalil SEN <halilsen@gmail.com> wrote:\n\n> Hello Shulhan,\n\nHi Halil,\n\n> \n> I just stumbled upon your patch while looking for the patch\n> that I sent at the beginning of this week for the exact same\n> issue.  It turns out you sent your patch two months ago.  I\n> should have checked before debugging :face_palm:\n> \n> If you would like to check it out, here is my patch in [1].\n> \n> I see that you have fixed resizeclistpanes but exact same issue\n> is present on resizecdetpanes as well.\n\nI have never encounter this issue.\n\n> \n> I am not sure if the conditional logic is necessary because we\n> are sure that `sash#` includes x, y positions in ttk mode but it\n> includes only the x position if not ttk. Also setting the y coord\n> to 0 might have unintended consequences.\n> \n\nI am new to Tcl/Tk at the time fixing this issue, so it kinda\ntry-and-error-patch with printf here and there.  Your patch is more\nsimple and fix the issue too.\n\n> \n> [1]\n> https://lore.kernel.org/git/0b5b8fb591e434a2a24b1f58d1ce3fc7da48a28e.1645386457.git.gitgitgadget@gmail.com/\n> \n> Signed-off-by: Halil Sen <halil.sen@gmail.com>\n\n-- \n{ \"github\":\"github.com/shuLhan\", \"site\":\"kilabit.info\" }\n"}]}