Code

gitk: Force the focus to the main window on Windows
authorJohannes Sixt <j6t@kdbg.org>
Thu, 18 Dec 2008 07:30:49 +0000 (08:30 +0100)
committerPaul Mackerras <paulus@samba.org>
Sun, 21 Dec 2008 23:16:18 +0000 (10:16 +1100)
On msysGit, the focus is first on the (Tk) console.  This console is then
hidden, but keeps the focus.  Work around that by forcing the focus onto
the gitk window.

This fixes msysGit issue 14.  Diagnosed and originally fixed by
Johannes Schindelin.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk

diff --git a/gitk b/gitk
index d72196911cf69110c299660929916bda2ce88ad6..dc2a439618ffd92a92d9ca954a8597ba31875dab 100755 (executable)
--- a/gitk
+++ b/gitk
@@ -10914,4 +10914,9 @@ if {[info exists permviews]} {
        addviewmenu $n
     }
 }
+
+if {[tk windowingsystem] eq "win32"} {
+    focus -force .
+}
+
 getcommits {}