All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] gitk: include y coord in recorded sash position
@ 2022-02-20 19:47 Halil Sen via GitGitGadget
  2022-02-20 19:47 ` [PATCH 1/2] gitk: trivial indentation fix halilsen via GitGitGadget
  2022-02-20 19:47 ` [PATCH 2/2] gitk: include y coord in recorded sash position halilsen via GitGitGadget
  0 siblings, 2 replies; 3+ messages in thread
From: Halil Sen via GitGitGadget @ 2022-02-20 19:47 UTC (permalink / raw)
  To: git; +Cc: Paul Mackerras, Anders Kaseorg, Junio C Hamano, Halil Sen

This PR fixes the issue reported by Anders Kaseorg in 1
[https://public-inbox.org/git/1f6e179c-d9c3-e503-3218-0acf4ff27cca@mit.edu/].

6cd80496e9 ("gitk: Resize panes correctly when reducing window size",
2020-10-03) introduces a mechanism to record previously-set sash positions
to make sure that correct values are used while computing resize
proportions.

However, if we are not using ttk, then sash represents only the x coordinate
and the recorded sash (oldsash) only includes the x coordinate. When we need
to access the y coordinate via the recorded sash position, we generate the
following Application Error popup:

    Error: expected integer but got ""
    
    expected integer but got ""
    
    expected integer but got ""
    
         while executing
    
    "$win sash place 0 $sash0 [lindex $s0 1]"
    
         (procedure "resizeclistpanes" line 38)
    
         invoked from within
    
    "resizeclistpanes .tf.histframe.pwclist 2818"
    
         (command bound to event)


To fix this, if we are not using ttk, we append the sash positions with the
y coordinates before recording them to match the use_ttk case.

halilsen (2):
  gitk: trivial indentation fix
  gitk: include y coord in recorded sash position

 gitk-git/gitk | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)


base-commit: e6ebfd0e8cbbd10878070c8a356b5ad1b3ca464e
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1219%2Fsenhalil%2Fmaster-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1219/senhalil/master-v1
Pull-Request: https://github.com/git/git/pull/1219
-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] gitk: trivial indentation fix
  2022-02-20 19:47 [PATCH 0/2] gitk: include y coord in recorded sash position Halil Sen via GitGitGadget
@ 2022-02-20 19:47 ` halilsen via GitGitGadget
  2022-02-20 19:47 ` [PATCH 2/2] gitk: include y coord in recorded sash position halilsen via GitGitGadget
  1 sibling, 0 replies; 3+ messages in thread
From: halilsen via GitGitGadget @ 2022-02-20 19:47 UTC (permalink / raw)
  To: git; +Cc: Paul Mackerras, Anders Kaseorg, Junio C Hamano, Halil Sen,
	halilsen

From: halilsen <halil.sen@mapotempo.com>

No functional changes.

Signed-off-by: Halil Sen <halil.sen@gmail.com>
---
 gitk-git/gitk | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/gitk-git/gitk b/gitk-git/gitk
index 23d9dd1fe0d..c31a8b4e2f8 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -2955,9 +2955,9 @@ proc savestuff {w} {
 proc resizeclistpanes {win w} {
     global oldwidth oldsash use_ttk
     if {[info exists oldwidth($win)]} {
-	if {[info exists oldsash($win)]} {
-	    set s0 [lindex $oldsash($win) 0]
-	    set s1 [lindex $oldsash($win) 1]
+        if {[info exists oldsash($win)]} {
+            set s0 [lindex $oldsash($win) 0]
+            set s1 [lindex $oldsash($win) 1]
         } elseif {$use_ttk} {
             set s0 [$win sashpos 0]
             set s1 [$win sashpos 1]
@@ -2992,7 +2992,7 @@ proc resizeclistpanes {win w} {
             $win sash place 0 $sash0 [lindex $s0 1]
             $win sash place 1 $sash1 [lindex $s1 1]
         }
-	set oldsash($win) [list $sash0 $sash1]
+        set oldsash($win) [list $sash0 $sash1]
     }
     set oldwidth($win) $w
 }
@@ -3000,8 +3000,8 @@ proc resizeclistpanes {win w} {
 proc resizecdetpanes {win w} {
     global oldwidth oldsash use_ttk
     if {[info exists oldwidth($win)]} {
-	if {[info exists oldsash($win)]} {
-	    set s0 $oldsash($win)
+        if {[info exists oldsash($win)]} {
+            set s0 $oldsash($win)
         } elseif {$use_ttk} {
             set s0 [$win sashpos 0]
         } else {
@@ -3024,7 +3024,7 @@ proc resizecdetpanes {win w} {
         } else {
             $win sash place 0 $sash0 [lindex $s0 1]
         }
-	set oldsash($win) $sash0
+        set oldsash($win) $sash0
     }
     set oldwidth($win) $w
 }
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] gitk: include y coord in recorded sash position
  2022-02-20 19:47 [PATCH 0/2] gitk: include y coord in recorded sash position Halil Sen via GitGitGadget
  2022-02-20 19:47 ` [PATCH 1/2] gitk: trivial indentation fix halilsen via GitGitGadget
@ 2022-02-20 19:47 ` halilsen via GitGitGadget
  1 sibling, 0 replies; 3+ messages in thread
From: halilsen via GitGitGadget @ 2022-02-20 19:47 UTC (permalink / raw)
  To: git; +Cc: Paul Mackerras, Anders Kaseorg, Junio C Hamano, Halil Sen,
	halilsen

From: halilsen <halil.sen@mapotempo.com>

6cd80496e9 ("gitk: Resize panes correctly when reducing window size",
2020-10-03) introduces a mechanism to record previously-set sash
positions to make sure that correct values are used while computing
resize proportions. However, if we are not using ttk, then sash
represents only the x coordinate and the recorded sash (`oldsash`) only
includes the x coordinate. When we need to access the y coordinate via
the recorded sash position, we generate the following Application Error
popup:

Error: expected integer but got ""

expected integer but got ""

expected integer but got ""

     while executing

"$win sash place 0 $sash0 [lindex $s0 1]"

     (procedure "resizeclistpanes" line 38)

     invoked from within

"resizeclistpanes .tf.histframe.pwclist 2818"

     (command bound to event)

To fix this, if we are not using ttk, we append the sash positions with
the y coordinates before recording them to match the use_ttk case.

Signed-off-by: Halil Sen <halil.sen@gmail.com>
---
 gitk-git/gitk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gitk-git/gitk b/gitk-git/gitk
index c31a8b4e2f8..0ae7d685904 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -2991,6 +2991,8 @@ proc resizeclistpanes {win w} {
         } else {
             $win sash place 0 $sash0 [lindex $s0 1]
             $win sash place 1 $sash1 [lindex $s1 1]
+            set sash0 [list $sash0 [lindex $s0 1]]
+            set sash1 [list $sash1 [lindex $s1 1]]
         }
         set oldsash($win) [list $sash0 $sash1]
     }
@@ -3023,6 +3025,7 @@ proc resizecdetpanes {win w} {
             $win sashpos 0 $sash0
         } else {
             $win sash place 0 $sash0 [lindex $s0 1]
+            set sash0 [list $sash0 [lindex $s0 1]]
         }
         set oldsash($win) $sash0
     }
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-20 19:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-20 19:47 [PATCH 0/2] gitk: include y coord in recorded sash position Halil Sen via GitGitGadget
2022-02-20 19:47 ` [PATCH 1/2] gitk: trivial indentation fix halilsen via GitGitGadget
2022-02-20 19:47 ` [PATCH 2/2] gitk: include y coord in recorded sash position halilsen via GitGitGadget

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.