git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] gitk - enable selected patch text on Windows

From
Mark Levedahl <mdl123@verizon.net>
Date
Aug 8, 2007, 01:40 UTC
Message-ID
<11865372352543-git-send-email-mdl123@verizon.net>
In-Reply-To
<1186440352826-git-send-email-mdl123@verizon.net>

On windows, mouse input follows the keyboard focus, so to allow selecting text from the patch canvas we must not shift focus back to the top level. This change has no negative impact on X, so we don't explicitly test for Win32 on this change. This provides similar selection capability as already available using X-Windows.

Signed-off-by: Mark Levedahl <mdl123@verizon.net>
---

This version enforces setting focus to the top level window whenever a scrolling command is issued. The first version lacked that and could allow some letters to erroneously appear in the patch window. This was purely cosmetic but annoying to one co-worker on a very slow machine.

 gitk |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/gitk b/gitk
index f74ce51..84f5ee4 100755
--- a/gitk
+++ b/gitk
@@ -955,8 +955,8 @@ proc bindkey {ev script} {
 # set the focus back to the toplevel for any click outside
 # the entry widgets
 proc click {w} {
-    global entries
-    foreach e $entries {
+    global ctext entries
+    foreach e [concat $entries $ctext] {
 	if {$w == $e} return
     }
     focus .
@@ -4565,6 +4565,7 @@ proc sellastline {} {

 proc selnextline {dir} {
     global selectedline
+    focus .
     if {![info exists selectedline]} return
     set l [expr {$selectedline + $dir}]
     unmarkmatches
@@ -4645,6 +4646,7 @@ proc godo {elt} {

 proc goback {} {
     global history historyindex
+    focus .

     if {$historyindex > 1} {
 	incr historyindex -1
@@ -4658,6 +4660,7 @@ proc goback {} {

 proc goforw {} {
     global history historyindex
+    focus .

     if {$historyindex < [llength $history]} {
 	set cmd [lindex $history $historyindex]
--
1.5.3.rc4.25.gade7b9
Previous: Mark LevedahlNext: Mark Levedahl
Message 3 of 6 in “gitk - enable selected patch text on Windows”
  1. gitk - enable selected patch text on WindowsMark Levedahl, Aug 6, 2007
  2. gitk - Handle MouseWheel events on WindowsMark Levedahl, Aug 6, 2007
  3. gitk - enable selected patch text on WindowsMark Levedahl, Aug 8, 2007
  4. gitk - Handle MouseWheel events on WindowsMark Levedahl, Aug 8, 2007
  5. Mark LevedahlAug 11, 2007
  6. Steffen ProhaskaAug 11, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.