Subject: [PATCH v2] gitk: force the focus to the main window on Windows

From: Johannes Sixt <[email-masked]>
Date: Thu, 18 Dec 2008 08:30:49 +0100

From: Johannes Sixt <[email-masked]>

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 <[email-masked]>
---
Paul Mackerras schrieb:
> At least put a if {[tk windowingsystem] eq "win32"} in there.
> (msysGit is a windows thing, isn't it?)

I did that.

-- Hannes

 gitk |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/gitk b/gitk
index b63109b..121b621 100644
--- a/gitk
+++ b/gitk
@@ -10898,4 +10898,9 @@ if {[info exists permviews]} {
 	addviewmenu $n
     }
 }
+
+if {[tk windowingsystem] eq "win32"} {
+    focus -force .
+}
+
 getcommits {}
-- 
1.6.1.rc3.950.g5dd2