threads / discuss / 10790

gitk/git-gui misfeature: saving the geometry can the window out of reach

Subject: gitk/git-gui misfeature: saving the geometry can the window out of reach

## tl;dr

3 messages between Nov 10, 2007 and Nov 11, 2007.

replies: 2people: 2as markdown or json

Benoit Sigoure· Nov 10, 2007, 21:48 UTC · lore
Hello list,

gitk (and I think git-gui too) save their "geometry" (which includes X/Y position) in ~/.gitk. So far so good. The problem is that I often use 2 screens at work (one is the screen of my laptop, the other one is above) and I happen to put my gitk/git-gui windows on the 2nd screen. When I go back home, I don't have a second screen and gitk/git-gui open their windows out of reach. This could well be an ugly wart in Apple's port of Tcl/Tk (I have a MacBook with OSX 10.4.10) or a more general problem (didn't try with other OSes).

git-gui version 0.8.4 git version 1.5.3.5.654.gdd5ec (tonight's master's HEAD) Tcl/Tk version 8.4.7 (Apple's) (gitk doesn't support --version!)

For those struggling with the same problem, here is a quick workaround:
   gnused -i /geometry/d ~/.gitk
Cheers,
-- 
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory
Shawn O. Pearce· Nov 11, 2007, 05:11 UTC · re: Benoit Sigoure · lore

Re: gitk/git-gui misfeature: saving the geometry can the window out of reach

Benoit Sigoure <tsuna@lrde.epita.fr> wrote:
Show 16 quoted lines
> gitk (and I think git-gui too) save their "geometry" (which includes  
> X/Y position) in ~/.gitk.  So far so good.  The problem is that I  
> often use 2 screens at work (one is the screen of my laptop, the  
> other one is above) and I happen to put my gitk/git-gui windows on  
> the 2nd screen.  When I go back home, I don't have a second screen  
> and gitk/git-gui open their windows out of reach.  This could well be  
> an ugly wart in Apple's port of Tcl/Tk (I have a MacBook with OSX  
> 10.4.10) or a more general problem (didn't try with other OSes).
> 
> git-gui version 0.8.4
> git version 1.5.3.5.654.gdd5ec (tonight's master's HEAD)
> Tcl/Tk version 8.4.7 (Apple's)
> (gitk doesn't support --version!)
> 
> For those struggling with the same problem, here is a quick workaround:
>   gnused -i /geometry/d ~/.gitk

Actually git-gui saves the geometry to .git/config so I'm not sure why the sed line above would correct git-gui's display issues. But I have also noticed this problem on my Mac OS X laptop when running again after leaving either git-gui or gitk on the external display.

I once started working on a fix for git-gui but put it aside as I didn't have an external monitor handy. I haven't hooked one up to my laptop in months so it would be a bit of work for me to test and debug.

-- 
Shawn.
Shawn O. Pearce· Nov 11, 2007, 10:44 UTC · lore

Re: gitk/git-gui misfeature: saving the geometry can the window out of reach

Benoit Sigoure <tsuna@lrde.epita.fr> wrote:
Show 16 quoted lines
> On Nov 11, 2007, at 6:11 AM, Shawn O. Pearce wrote:
> >Benoit Sigoure <tsuna@lrde.epita.fr> wrote:
> >>gitk (and I think git-gui too) save their "geometry" (which includes
> >>X/Y position) in ~/.gitk.  So far so good.  The problem is that I
> >>often use 2 screens at work (one is the screen of my laptop, the
> >>other one is above) and I happen to put my gitk/git-gui windows on
> >>the 2nd screen.  When I go back home, I don't have a second screen
> >>and gitk/git-gui open their windows out of reach.
> >
> >Actually git-gui saves the geometry to .git/config so I'm not sure
> >why the sed line above would correct git-gui's display issues.  But I
> >have also noticed this problem on my Mac OS X laptop when running
> >again after leaving either git-gui or gitk on the external display.
> 
> it's been a long time since I last used Tcl/Tk but if you give me a  
> hint as to where to look / what should be done, I can give it a try.

Look in git-gui.sh for "-- Load geometry"; in my current master it is on line 2625. This is the block where we have taken the geometry data back in from .git/config and are trying to update the UI to match what it says. Unfortunately we set a coordinate that is off the desktop using a standard X geometry string in the "wm geometry . [lindex $gm 0]" call...

-- 
Shawn.

← back to recent threads