Skip to contentSkip to conversation

Bug in gitk - can post the window off screen

PATCH In review Tommy Thorn 12 participants 26 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Just a quick heads-up: I was running a dual screen setup with gitk on my 2nd monitor. When I later started gitk up without the 2nd monitor, the gitk window didn't appear. Given the time between the two sessions, it didn't occur to me what the problem was.

Gitk should probably validate the "set geometry(main)" variable against the current resolution.

Tommy

#1 lore raw
Quoted 7 lines · Tommy Thorn

Just a quick heads-up: I was running a dual screen setup with gitk on my 2nd monitor. When I later started gitk up without the 2nd monitor, the gitk window didn't appear. Given the time between the two sessions, it didn't occur to me what the problem was.

Gitk should probably validate the "set geometry(main)" variable against the current resolution.

Sad to say but this is a known issue with both gitk and git-gui. Both applications save the prior geometry and restore it during the next run, but neither validates the new geometry makes sense with the current available desktop space. :-\

Signature · 1 line
Shawn.
#2 lore raw

torsdagen den 7 februari 2008 skrev Shawn O. Pearce:

Quoted 6 lines
Quoted 5 lines · Tommy Thorn

Just a quick heads-up: I was running a dual screen setup with gitk on my 2nd monitor. When I later started gitk up without the 2nd monitor, the gitk window didn't appear. Given the time between the two sessions, it didn't occur to me what the problem was.

Quoted 7 lines
Quoted 2 lines

Gitk should probably validate the "set geometry(main)" variable against the current resolution.

Sad to say but this is a known issue with both gitk and git-gui. Both applications save the prior geometry and restore it during the next run, but neither validates the new geometry makes sense with the current available desktop space. :-\

Seems KDE forces it back into visible space, but it is annoying that the gitk/git-gui windows do not come up on the same monitor as my cursor is on. Could we change it and save just size, just like "all other" apps?

-- robin

#3 lore raw
Quoted 10 lines · Robin Rosenberg

torsdagen den 7 februari 2008 skrev Shawn O. Pearce:

Quoted 9 lines
Quoted 7 lines · Tommy Thorn

Just a quick heads-up: I was running a dual screen setup with gitk on my 2nd monitor. When I later started gitk up without the 2nd monitor, the gitk window didn't appear. Given the time between the two sessions, it didn't occur to me what the problem was.

Gitk should probably validate the "set geometry(main)" variable against the current resolution.

Quoted 8 lines
Quoted 4 lines

Sad to say but this is a known issue with both gitk and git-gui. Both applications save the prior geometry and restore it during the next run, but neither validates the new geometry makes sense with the current available desktop space. :-\

Seems KDE forces it back into visible space, but it is annoying that the gitk/git-gui windows do not come up on the same monitor as my cursor is on. Could we change it and save just size, just like "all other" apps?

Not saving the geometry on exit was also suggested through the Debian BTS, "as window placement and sizing are the task of the window manager"
http://bugs.debian.org/442253

Regards, Gerrit.

#4 lore raw

PATCH 1/1 gitk: don't save the geometry to rc file on exit

Saving the geometry can cause several inconveniences, e.g. when using a temporary dual screen setup, or sharing ~/.gitk between multiple systems. Additionally it can be argued that window placement and sizing are the tasks of the window manager. So don't do that anymore.

This has been requested by martin f krafft and Josh Triplett through
http://bugs.debian.org/442253
http://bugs.debian.org/467121

---
 gitk-git/gitk |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)
gitk-git/gitk +0 -8
index f1f21e9..8039d19 100644
@@ -1188,14 +1188,6 @@ proc savestuff {w} {
 	puts $f [list set diffcontext $diffcontext]
 	puts $f [list set selectbgcolor $selectbgcolor]
 
-	puts $f "set geometry(main) [wm geometry .]"
-	puts $f "set geometry(topwidth) [winfo width .tf]"
-	puts $f "set geometry(topheight) [winfo height .tf]"
-        puts $f "set geometry(pwsash0) \"[.tf.histframe.pwclist sash coord 0]\""
-        puts $f "set geometry(pwsash1) \"[.tf.histframe.pwclist sash coord 1]\""
-	puts $f "set geometry(botwidth) [winfo width .bleft]"
-	puts $f "set geometry(botheight) [winfo height .bleft]"
-
 	puts -nonewline $f "set permviews {"
 	for {set v 0} {$v < $nextviewnum} {incr v} {
 	    if {$viewperm($v)} {
Signature · 1 line
1.5.4.2
#5 lore raw

Re: [PATCH] gitk: don't save the geometry to rc file on exit

Quoted 4 lines · Gerrit Pape

Saving the geometry can cause several inconveniences, e.g. when using a temporary dual screen setup, or sharing ~/.gitk between multiple systems. Additionally it can be argued that window placement and sizing are the tasks of the window manager. So don't do that anymore.

I myself find it useful to have gitk remember the size and layout of the various panes, so I won't be applying this patch.

The saving/restoring of the window position was done by Mark Levedahl to make gitk work properly on Cygwin. I agree it can be annoying on X and I would take a patch to inhibit the restoring of the window position when running under X. I'd want an ack from Mark before making that change more generally.

Paul.

#6 lore raw

Re: [PATCH] gitk: don't save the geometry to rc file on exit

Quoted 12 lines · Paul Mackerras
Quoted 5 lines · Gerrit Pape

Saving the geometry can cause several inconveniences, e.g. when using a temporary dual screen setup, or sharing ~/.gitk between multiple systems. Additionally it can be argued that window placement and sizing are the tasks of the window manager. So don't do that anymore.

I myself find it useful to have gitk remember the size and layout of the various panes, so I won't be applying this patch.

Quoted 9 lines

The saving/restoring of the window position was done by Mark Levedahl to make gitk work properly on Cygwin. I agree it can be annoying on X and I would take a patch to inhibit the restoring of the window position when running under X. I'd want an ack from Mark before making that change more generally.

Paul.

I can only offer to test the proposed patch, I am unable to predict what will or won't trip up the buggy geometry engine in Cygwin's Tk. I do remember I had trouble finding a way to restore the size but not the position of the main window on Cygwin: that doesn't mean it can't be done (logically, it should be easy), just that I didn't find the right spell or incantation that would work. I'll also admit to not having tried after I got to a completely working geometry solution, so perhaps just restoring the size without position will now work on Cygwin.

Using the saved panel sizes in conjunction with the default window size yields an unusable screen: many elements are obscured. The same occurs using the defaults altogether: either way the user must resize and adjust things to get to a workable layout. So, I am very opposed to disabling the memory altogether. Also, I have a number of X apps that remember their layout, so gitk's current behavior is not (at least to me) an aberration and I would like that behavior to at least remain an option.

Mark

#7 lore raw

Re: [PATCH] gitk: don't save the geometry to rc file on exit

Quoted 3 lines · Mark Levedahl

[...] so gitk's current behavior is not (at least to me) an aberration and I would like that behavior to at least remain an option.

It would be really annoying if I had to resize and reconfigure (the panes) each time I start gitk.

How about only taking the saved geometry/fonts/etc when the screen size hasn't changed?

The easiest method (for a Tcl-noob like me) would be to wrap the "set geometry..." in .gitk with an if-statement which checks the screen size.

Something like this:

gitk-git/gitk +8 -3
index 5560e4d..1c572c9 100644
@@ -1158,14 +1158,12 @@ proc savestuff {w} {
     global viewname viewfiles viewargs viewperm nextviewnum
     global cmitmode wrapcomment datetimeformat limitdiffs
     global colors bgcolor fgcolor diffcolors diffcontext selectbgcolor
+    global screen_size
 
     if {$stuffsaved} return
     if {![winfo viewable .]} return
     catch {
 	set f [open "~/.gitk-new" w]
-	puts $f [list set mainfont $mainfont]
-	puts $f [list set textfont $textfont]
-	puts $f [list set uifont $uifont]
 	puts $f [list set tabstop $tabstop]
 	puts $f [list set findmergefiles $findmergefiles]
 	puts $f [list set maxgraphpct $maxgraphpct]
@@ -1183,6 +1181,10 @@ proc savestuff {w} {
 	puts $f [list set diffcontext $diffcontext]
 	puts $f [list set selectbgcolor $selectbgcolor]
 
+	puts $f "if {\$screen_size == \"$screen_size\"} {"
+	puts $f [list set mainfont $mainfont]
+	puts $f [list set textfont $textfont]
+	puts $f [list set uifont $uifont]
 	puts $f "set geometry(main) [wm geometry .]"
 	puts $f "set geometry(topwidth) [winfo width .tf]"
 	puts $f "set geometry(topheight) [winfo height .tf]"
@@ -1198,6 +1200,7 @@ proc savestuff {w} {
 	    }
 	}
 	puts $f "}"
+	puts $f "}"
 	close $f
 	file rename -force "~/.gitk-new" "~/.gitk"
     }
@@ -8461,6 +8464,8 @@ set diffcolors {red "#00a000" blue}
 set diffcontext 3
 set selectbgcolor gray85
 
+set screen_size [winfo screenwidth .]x[winfo screenheight .]
+
 ## For msgcat loading, first locate the installation location.
 if { [info exists ::env(GITK_MSGSDIR)] } {
     ## Msgsdir was manually set in the environment.

Saving geometries for multiple screen sizes would be even better (i.e. geometry_1440x900(main) etc or an additional ".gitk-$screen_size" for the geometry data) but that is beyond my Tcl-skills.

Ciao, ET.

#8 lore raw

Re: [PATCH] gitk: don't save the geometry to rc file on exit

In reply to Mark Levedahl
Quoted 9 lines · Mark Levedahl

I can only offer to test the proposed patch, I am unable to predict what will or won't trip up the buggy geometry engine in Cygwin's Tk. I do remember I had trouble finding a way to restore the size but not the position of the main window on Cygwin: that doesn't mean it can't be done (logically, it should be easy), just that I didn't find the right spell or incantation that would work. I'll also admit to not having tried after I got to a completely working geometry solution, so perhaps just restoring the size without position will now work on Cygwin.

Quoted 8 lines

Using the saved panel sizes in conjunction with the default window size yields an unusable screen: many elements are obscured. The same occurs using the defaults altogether: either way the user must resize and adjust things to get to a workable layout. So, I am very opposed to disabling the memory altogether. Also, I have a number of X apps that remember their layout, so gitk's current behavior is not (at least to me) an aberration and I would like that behavior to at least remain an option.

Here's a patch for people to test. It only restores the width and height, and limits the width and height to be at most the width and height of the screen. It seems to work fine under X; I would be interested to know what happens under macos and windows.

Paul.
---

gitk +10 -2
index f1f21e9..f8f006f 100755
@@ -930,9 +930,17 @@ proc makewindow {} {
     .pwbottom add .bright
     .ctop add .pwbottom
 
-    # restore window position if known
+    # restore window width & height if known
     if {[info exists geometry(main)]} {
-        wm geometry . "$geometry(main)"
+	if {[scan $geometry(main) "%dx%d" w h] >= 2} {
+	    if {$w > [winfo screenwidth .]} {
+		set w [winfo screenwidth .]
+	    }
+	    if {$h > [winfo screenheight .]} {
+		set h [winfo screenheight .]
+	    }
+	    wm geometry . "${w}x$h"
+	}
     }
 
     if {[tk windowingsystem] eq {aqua}} {
#9 lore raw

Re: [PATCH] gitk: don't save the geometry to rc file on exit

also sprach Paul Mackerras <[email protected]> [2008.03.06.1317 +0100]:

Quoted 4 lines

Here's a patch for people to test. It only restores the width and height, and limits the width and height to be at most the width and height of the screen. It seems to work fine under X; I would be interested to know what happens under macos and windows.

I can confirm that the behaviour is much better: the window size is restored, as is the position, but it gives preference to the Xinerama head. You'd think it restores at the same *relative* position on the current head, but it actually just restores somewhere — I cannot figure out the behaviour.

However, I still wonder why we have to do this at all. I understand that Cygwin has issues and needs this code, but couldn't it then be made to run only on Cygwin, such that on "proper" Unix systems, the config file is *not* updated every time I move the window before closing the application? As I said earlier, this is really the job of a window manager, *not* a configuration option. If your window manager cannot restore the window to a size you control, then it's broken. Let's not hack applications to work around that, please.

Signature · 5 lines
martin | http://madduck.net/ | http://two.sentenc.es/
 
$complex->{'data'}[$structures][$in_perl] = @{$can{'be'}->[$painful]};
 
spamtraps: [email protected]
#10 lore raw

Re: [PATCH] gitk: don't save the geometry to rc file on exit

Quoted 5 lines · martin f krafft

I can confirm that the behaviour is much better: the window size is restored, as is the position, but it gives preference to the Xinerama head. You'd think it restores at the same *relative* position on the current head, but it actually just restores somewhere $,1rt(B I cannot figure out the behaviour.

The position is entirely up to your window manager.

Quoted 1 line

However, I still wonder why we have to do this at all.

Well, try it without... :)

Restoring the overall window size and the positions of the sashes of the panedwindows is the simplest and most reliable method I have found for making the window come back the way the user last set it.

Quoted 5 lines

I understand
that Cygwin has issues and needs this code, but couldn't it then be made to run only on Cygwin, such that on "proper" Unix systems, the config file is *not* updated every time I move the window before closing the application?

What's the issue with updating the config file?

Quoted 4 lines

As I said earlier, this is really the job
of a window manager, *not* a configuration option. If your window manager cannot restore the window to a size you control, then it's broken. Let's not hack applications to work around that, please.

I disagree. It's not a window manager's job to tell an application how big its window should be.

Paul.

#11 lore raw

Re: [PATCH] gitk: don't save the geometry to rc file on exit

also sprach Paul Mackerras <[email protected]> [2008.03.08.1211 +0100]:

Quoted 6 lines
Quoted 4 lines

I understand that Cygwin has issues and needs this code, but couldn't it then be made to run only on Cygwin, such that on "proper" Unix systems, the config file is *not* updated every time I move the window before closing the application?

What's the issue with updating the config file?

Conflicts when synchronising the files between different machines, or the need for a custom merge driver just for .gitkrc files.

Quoted 7 lines
Quoted 4 lines

As I said earlier, this is really the job of a window manager, *not* a configuration option. If your window manager cannot restore the window to a size you control, then it's broken. Let's not hack applications to work around that, please.

I disagree. It's not a window manager's job to tell an application how big its window should be.

I always assumed it was: position and geometry. However, I am starting to see your point.

I guess the best way would be a checkbox with which I can disable the saving of the geometry on application close, possibly paired with a button "save now".

Signature · 7 lines
martin | http://madduck.net/ | http://two.sentenc.es/
 
an egg has the shortest sex-life of all: if gets laid once; it gets
eaten once. it also has to come in a box with 11 others, and the
only person who will sit on its face is its mother.
 
spamtraps: [email protected]
#12 lore raw

Re: [PATCH] gitk: don't save the geometry to rc file on exit

In reply to Paul Mackerras

2008/3/8 Paul Mackerras <[email protected]>:

Quoted 7 lines
Quoted 4 lines

As I said earlier, this is really the job
of a window manager, *not* a configuration option. If your window manager cannot restore the window to a size you control, then it's broken. Let's not hack applications to work around that, please.

I disagree. It's not a window manager's job to tell an application how big its window should be.

There are some modestly popular tiling window managers that attempt to remove the bother of having to manually move windows around which take the view that the window manager's decisions should only be overruled in the very rare cases where it's absolutely necessary, eg,

Ion http://modeemi.fi/~tuomov/ion/
dwm http://www.suckless.org/wiki/dwm

(The major windows that don't resize well are from image based programs where you want exactly the underlying image on your display. Text based programs like gitk work great under autoresizing.) However, the current gitk appears to work fine on those window managers because the internal dividers get automtatically resized whenever the global window resizes, and the wm resizes the window so quickly after creation I don't have time to notice it.

Signature · 5 lines
cheers, dave tweed__________________________
[email protected]
Rm 124, School of Systems Engineering, University of Reading.
"while having code so boring anyone can maintain it, use Python." --
attempted insult seen on slashdot
#13 lore raw

Re: [PATCH] gitk: don't save the geometry to rc file on exit

In reply to Paul Mackerras
Quoted 22 lines · Paul Mackerras

Here's a patch for people to test. It only restores the width and height, and limits the width and height to be at most the width and height of the screen. It seems to work fine under X; I would be interested to know what happens under macos and windows.

Paul.
---

gitk +3 -2
index f1f21e9..f8f006f 100755
@@ -930,9 +930,17 @@ proc makewindow {} {
     .pwbottom add .bright
     .ctop add .pwbottom
 
-    # restore window position if known
+    # restore window width & height if known
     if {[info exists geometry(main)]} {
-        wm geometry . "$geometry(main)"
+	if {[scan $geometry(main) "%dx%d" w h] >= 2} {
+	    if {$w > [winfo screenwidth .]} {

gitk proc makewindow {} { · line 946

Quoted 10 lines
gitk +7 -0
+		set w [winfo screenwidth .]
+	    }
+	    if {$h > [winfo screenheight .]} {
+		set h [winfo screenheight .]
+	    }
+	    wm geometry . "${w}x$h"
+	}
     }
 
     if {[tk windowingsystem] eq {aqua}} {

This works fine on Cygwin: the size restores properly across sessions, the window and widgets all behave as expected. So, you can add a "Tested-by: Mark Levedahl <[email protected]" if you wish to this.

Mark

#14 lore raw

Re: [PATCH] gitk: don't save the geometry to rc file on exit

In reply to Paul Mackerras
Quoted 52 lines · Paul Mackerras
Quoted 9 lines · Mark Levedahl

I can only offer to test the proposed patch, I am unable to predict what will or won't trip up the buggy geometry engine in Cygwin's Tk. I do remember I had trouble finding a way to restore the size but not the position of the main window on Cygwin: that doesn't mean it can't be done (logically, it should be easy), just that I didn't find the right spell or incantation that would work. I'll also admit to not having tried after I got to a completely working geometry solution, so perhaps just restoring the size without position will now work on Cygwin.

Quoted 8 lines

Using the saved panel sizes in conjunction with the default window size yields an unusable screen: many elements are obscured. The same occurs using the defaults altogether: either way the user must resize and adjust things to get to a workable layout. So, I am very opposed to disabling the memory altogether. Also, I have a number of X apps that remember their layout, so gitk's current behavior is not (at least to me) an aberration and I would like that behavior to at least remain an option.

Here's a patch for people to test. It only restores the width and height, and limits the width and height to be at most the width and height of the screen. It seems to work fine under X; I would be interested to know what happens under macos and windows.

Paul.
---
diff --git a/gitk b/gitk
index f1f21e9..f8f006f 100755
--- a/gitk
+++ b/gitk
@@ -930,9 +930,17 @@ proc makewindow {} {
.pwbottom add .bright
.ctop add .pwbottom

- # restore window position if known
+ # restore window width & height if known

     if {[info exists geometry(main)]} {
 -        wm geometry . "$geometry(main)"
 +       if {[scan $geometry(main) "%dx%d" w h] >= 2} {
 +           if {$w > [winfo screenwidth .]} {
 +               set w [winfo screenwidth .]
 +           }
 +           if {$h > [winfo screenheight .]} {
 +               set h [winfo screenheight .]
 +           }
 +           wm geometry . "${w}x$h"
 +       }
     }

     if {[tk windowingsystem] eq {aqua}} {
Quoted 2 lines

--

This almost works on OS X. The only problem is that it's not taking into account menubars and windowbars. eg, if I have a screen resolution of 640x480, setting the window _content_ to that size will make the entire window including its titlebar about 500px tall. Not only that, but the system-wide menubar at the top of the screen also reduces the available space, meaning that the maximum window size ought to be around 640x456. (If you wanted to get even pickier, that will changing depending on the interface resolution...)

Presumably your patch does nothing to move gitk back on screen if the monitor it was on last time has gone away? Or are we still blaming the window manager for that?

#15 lore raw

Re: [PATCH] gitk: don't save the geometry to rc file on exit

Quoted 8 lines · Jonathan del Strother

This almost works on OS X. The only problem is that it's not taking into account menubars and windowbars. eg, if I have a screen resolution of 640x480, setting the window _content_ to that size will make the entire window including its titlebar about 500px tall. Not only that, but the system-wide menubar at the top of the screen also reduces the available space, meaning that the maximum window size ought to be around 640x456. (If you wanted to get even pickier, that will changing depending on the interface resolution...)

Do you know of any way for an application to determine how big it can be, then?

Quoted 3 lines

Presumably your patch does nothing to move gitk back on screen if the monitor it was on last time has gone away? Or are we still blaming the window manager for that?

With the patch it no longer specifies a position, so yes we blame the window manager now if it doesn't put the window somewhere visible. :)

Paul.

#16 lore raw

Re: [PATCH] gitk: don't save the geometry to rc file on exit

In reply to Paul Mackerras

also sprach Paul Mackerras <[email protected]> [2008.02.23.2349 +0100]:

Quoted 6 lines
Quoted 5 lines

Saving the geometry can cause several inconveniences, e.g. when using a temporary dual screen setup, or sharing ~/.gitk between multiple systems. Additionally it can be argued that window placement and sizing are the tasks of the window manager. So don't do that anymore.

Quoted 8 lines

I myself find it useful to have gitk remember the size and layout of the various panes, so I won't be applying this patch.

The saving/restoring of the window position was done by Mark Levedahl to make gitk work properly on Cygwin. I agree it can be annoying on X and I would take a patch to inhibit the restoring of the window position when running under X. I'd want an ack from Mark before making that change more generally.

May I suggest that such a patch actually disables writing of the config file, so that we won't get conflicts every time you sync config files via home-in-git?

Of course I offer to look into this once Mark approves.

Signature · 7 lines
martin | http://madduck.net/ | http://two.sentenc.es/
 
"if there's anything more important than my ego,
 i want it caught and shot now."
                                                -- zaphod beeblebrox
 
spamtraps: [email protected]
#17 lore raw

Re: [PATCH] gitk: don't save the geometry to rc file on exit

Quoted 3 lines · martin f krafft

May I suggest that such a patch actually disables writing of the config file, so that we won't get conflicts every time you sync config files via home-in-git?

Then various other bits of config won't be persistent, such as font settings. So I don't think that's a good idea.

It would be possible to make the config file be per-repository rather than global, I guess, if that is something people want. I personally would find it annoying to have to change the font separately in each repository, but tastes differ, I guess.

Paul.

#18 lore raw

Re: [PATCH] gitk: don't save the geometry to rc file on exit

also sprach Paul Mackerras <[email protected]> [2008.02.25.1309 +0100]:

Quoted 2 lines

Then various other bits of config won't be persistent, such as font settings. So I don't think that's a good idea.

Huh? I use the same font on all machines, but the screen resolutions differ...

Signature · 6 lines
martin | http://madduck.net/ | http://two.sentenc.es/
 
time wounds all heels.
                                                       -- groucho marx
 
spamtraps: [email protected]
#19 lore raw

Re: [PATCH] gitk: don't save the geometry to rc file on exit

In reply to Paul Mackerras
Quoted 9 lines · Paul Mackerras
Quoted 3 lines · martin f krafft

May I suggest that such a patch actually disables writing of the config file, so that we won't get conflicts every time you sync config files via home-in-git?

Then various other bits of config won't be persistent, such as font settings. So I don't think that's a good idea.

Quoted 7 lines

It would be possible to make the config file be per-repository rather than global, I guess, if that is something people want. I personally would find it annoying to have to change the font separately in each repository, but tastes differ, I guess.

Paul.

Two things we could do:

1) Add a "save config now" button and a "save config on exit" checkbox/option to the options dialog.
2) Perform a screen geometry check at load time to see if the corners of the main window would be visible before applying the main window geometry.

Mark

#20 lore raw

Re: [PATCH] gitk: don't save the geometry to rc file on exit

also sprach Mark Levedahl <[email protected]> [2008.02.25.1435 +0100]:

Quoted 2 lines

1) Add a "save config now" button and a "save config on exit" checkbox/option to the options dialog.

and a checkbox like "disable writing window geometry data to the configuration file"

Quoted 3 lines

2) Perform a screen geometry check at load time to see if the corners of the main window would be visible before applying the main window geometry.

I don't see the benefit of this. I really rather believe that window geometry is the job of the window manager. If Cygwin needs it, then maybe it could be conditionally compiled on that platform.

Signature · 5 lines
martin | http://madduck.net/ | http://two.sentenc.es/
 
quantum mechanics: the dreams stuff is made of.
 
spamtraps: [email protected]
#21 lore raw

Re: [PATCH] gitk: don't save the geometry to rc file on exit

In reply to Mark Levedahl
Quoted 3 lines · Mark Levedahl

2) Perform a screen geometry check at load time to see if the corners of the main window would be visible before applying the main window geometry.

As a multi-screen-layouts, multi-machine user, this approach has my vote. I see a proto-patch from Edgar too. Even if the wm has similar capabilities, those will be limited to main window geometry, not inner-panel geometry so this is still useful.

cheers,

m

#22 lore raw

Re: [PATCH] gitk: don't save the geometry to rc file on exit

måndagen den 25 februari 2008 skrev Martin Langhoff:

Quoted 9 lines · Mark Levedahl
Quoted 3 lines

2) Perform a screen geometry check at load time to see if the corners of the main window would be visible before applying the main window geometry.

As a multi-screen-layouts, multi-machine user, this approach has my vote. I see a proto-patch from Edgar too. Even if the wm has similar capabilities, those will be limited to main window geometry, not inner-panel geometry so this is still useful.

The annoying part is that it remembers the position. Remembering siz I can live with, but I don't want it popping up the wrong screen.

-- robin

#23 lore raw

Re: [PATCH] gitk: don't save the geometry to rc file on exit

In reply to Paul Mackerras
Quoted 7 lines · Paul Mackerras
Quoted 4 lines · Gerrit Pape

Saving the geometry can cause several inconveniences, e.g. when using a temporary dual screen setup, or sharing ~/.gitk between multiple systems. Additionally it can be argued that window placement and sizing are the tasks of the window manager. So don't do that anymore.

Quoted 8 lines

I myself find it useful to have gitk remember the size and layout of the various panes, so I won't be applying this patch.

The saving/restoring of the window position was done by Mark Levedahl to make gitk work properly on Cygwin. I agree it can be annoying on X and I would take a patch to inhibit the restoring of the window position when running under X. I'd want an ack from Mark before making that change more generally.

I use gitk under X and like the saving/restoring of window size/geometry. Please do not remove that feature.

#24 lore raw

Re: [PATCH] gitk: don't save the geometry to rc file on exit

In reply to Gerrit Pape

lördagen den 23 februari 2008 skrev Gerrit Pape:

Quoted 4 lines

Saving the geometry can cause several inconveniences, e.g. when using a temporary dual screen setup, or sharing ~/.gitk between multiple systems. Additionally it can be argued that window placement and sizing are the tasks of the window manager. So don't do that anymore.

Shouldn't the restoring code also be dropped then?

Other than that, I agree. The Gitk current behaviour wrt dual screens is really inconvenient.

-- robin

#25 lore raw

Re: [PATCH] gitk: don't save the geometry to rc file on exit

Quoted 8 lines · Robin Rosenberg

lördagen den 23 februari 2008 skrev Gerrit Pape:

Quoted 4 lines

Saving the geometry can cause several inconveniences, e.g. when using a temporary dual screen setup, or sharing ~/.gitk between multiple systems. Additionally it can be argued that window placement and sizing are the tasks of the window manager. So don't do that anymore.

Shouldn't the restoring code also be dropped then?

Perhaps, though that would prevent you setting up default width & height. You'd always be stuck with the (too small IMO) original window size