Re: [PATCH] Make gitk work reasonably well on Cygwin.

From: Mark Levedahl <>
Date: 2007-02-01 12:41:55
The gitk gui layout was completely broken on Cygwin. If gitk was started
without previous geometry in ~/.gitk, the user could drag the window 
sashes to get a useable layout. However, if ~/.gitk existed, this was 
not possible at all.

The fix was to rewrite makewindow, changing the toplevel containers and
the particular geometry information saved between sessions. Numerous 
bugs in both the Cygwin and the Linux Tk versions make this a delicate
balancing act: the version here works in both but many subtle variants
are competely broken in one or the other environment.

Three user visible changes result:
1 - The viewer is fully functional under Cygwin.
2 - The search bar moves from the bottom to the top of the lower left
    pane. This was necessary to get around a layout problem on Cygwin.
3 - The window size and position is saved and restored between sessions.
    Again, this is necessary to get around a layout problem on Cygwin.

Also, responding to other comments on this thread:

1) Regarding the size of the patch. I tried many different approaches to 
getting the layout to work on Cgywin as well as Linux, ultimately the 
only approach that worked required changing the very top level structure 
containing the Tk widgets. As the  style used names all widgets using 
their parents, every widget's name is changed. This makes the patch seem 
more complex than it is, many changes  are just changing names. There 
might be a simpler solution, I didn't find it and I can find absolutely 
no indication from googling that anyone else has found a better solution.

2) I have changed the default window size (used only the first time gitk 
is run) to be smaller. This may address the problem of layout noted in 
mingw. Note that the search bar is not at the bottom left, but is now 
middle left. On cygwin, the widgets mostly resize with the window, but 
may not always do so if the resizing is significant, and in particular 
the lower left pane can extend below the window and be clipped. 
Restarting gitk after setting the desired geometry will cause all 
widgets to size correctly, so this layout problem is a minor annoyance 
suffered only the first time, and only on Cygwin (it does not happen on 

3) I have tried this extensively on Linux and Cygwin (the latter using 
the native Tcl /Tk as well as one built for the X-server under cygwin). 
This version of gitk works well in all, and as far as I can tell has no 
regressions from the current version while significantly improving the 
situation in native Cygwin.

Mark Levedahl

Received on Thu Feb 01 13:55:53 2007

This archive was generated by hypermail 2.1.8 : 2007-02-01 13:57:39 EST