git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] gitk: restore wm state to normal before saving geometry  information
@ 2009-09-08 18:44 Alexey Borzenkov
  0 siblings, 0 replies; 7+ messages in thread
From: Alexey Borzenkov @ 2009-09-08 18:44 UTC (permalink / raw)
  To: git; +Cc: Paul Mackerras

gitk now includes patches for saving and restoring wm state, however
because it saves wm geometry when window can still be maximized the
maximize/restore button becomes useless after restarting gitk (you
will get a huge displaced window if you try to restore it). This
patch fixes this issue by storing window geometry in normal state.

Signed-off-by: Alexey Borzenkov <snaury@gmail.com>
---
 Please don't forget to cc me if you have comments/questions

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

diff --git a/gitk b/gitk
index 8c08310..fedeb88 100755
--- a/gitk
+++ b/gitk
@@ -2555,8 +2555,11 @@ proc savestuff {w} {
 	puts $f [list set extdifftool $extdifftool]
 	puts $f [list set perfile_attrs $perfile_attrs]

-	puts $f "set geometry(main) [wm geometry .]"
 	puts $f "set geometry(state) [wm state .]"
+	if {[wm state .] eq {zoomed}} {
+		wm state . normal
+	}
+	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]\""
-- 
1.6.4.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH] gitk: restore wm state to normal before saving geometry information
@ 2009-09-08 19:22 Alexey Borzenkov
  2009-09-15 12:03 ` Pat Thoyts
  2009-09-16 10:21 ` Paul Mackerras
  0 siblings, 2 replies; 7+ messages in thread
From: Alexey Borzenkov @ 2009-09-08 19:22 UTC (permalink / raw)
  To: git; +Cc: paulus, Alexey Borzenkov

gitk now includes patches for saving and restoring wm state, however
because it saves wm geometry when window can still be maximized the
maximize/restore button becomes useless after restarting gitk (you
will get a huge displaced window if you try to restore it). This
patch fixes this issue by storing window geometry in normal state.

Signed-off-by: Alexey Borzenkov <snaury@gmail.com>
---
 My previous email didn't come out rights, I hope this one will
 Don't forget to cc me if you have any comments/questions

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

diff --git a/gitk b/gitk
index 8c08310..fedeb88 100755
--- a/gitk
+++ b/gitk
@@ -2555,8 +2555,11 @@ proc savestuff {w} {
 	puts $f [list set extdifftool $extdifftool]
 	puts $f [list set perfile_attrs $perfile_attrs]
 
-	puts $f "set geometry(main) [wm geometry .]"
 	puts $f "set geometry(state) [wm state .]"
+	if {[wm state .] eq {zoomed}} {
+		wm state . normal
+	}
+	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]\""
-- 
1.6.4.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] gitk: restore wm state to normal before saving geometry information
  2009-09-08 19:22 Alexey Borzenkov
@ 2009-09-15 12:03 ` Pat Thoyts
  2009-09-15 12:54   ` Alexey Borzenkov
  2009-09-16 10:21 ` Paul Mackerras
  1 sibling, 1 reply; 7+ messages in thread
From: Pat Thoyts @ 2009-09-15 12:03 UTC (permalink / raw)
  To: git; +Cc: Alexey Borzenkov

Alexey Borzenkov <snaury@gmail.com> writes:

>gitk now includes patches for saving and restoring wm state, however
>because it saves wm geometry when window can still be maximized the
>maximize/restore button becomes useless after restarting gitk (you
>will get a huge displaced window if you try to restore it). This
>patch fixes this issue by storing window geometry in normal state.
>

I tried this patch on windows and I find that it causes the columns in
the top view to creep each time you restart the application. This is I
think due to the way this patch sets the state to normal before
recording all the settings.

I will post an alternative patch that records the normal geometry
whenever it changes instead which seems to work better for me.

-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gitk: restore wm state to normal before saving geometry  information
  2009-09-15 12:03 ` Pat Thoyts
@ 2009-09-15 12:54   ` Alexey Borzenkov
  2009-09-15 13:58     ` Alexey Borzenkov
  0 siblings, 1 reply; 7+ messages in thread
From: Alexey Borzenkov @ 2009-09-15 12:54 UTC (permalink / raw)
  To: Pat Thoyts; +Cc: git

On Tue, Sep 15, 2009 at 4:03 PM, Pat Thoyts
<patthoyts@users.sourceforge.net> wrote:
>>gitk now includes patches for saving and restoring wm state, however
>>because it saves wm geometry when window can still be maximized the
>>maximize/restore button becomes useless after restarting gitk (you
>>will get a huge displaced window if you try to restore it). This
>>patch fixes this issue by storing window geometry in normal state.
> I tried this patch on windows and I find that it causes the columns in
> the top view to creep each time you restart the application. This is I
> think due to the way this patch sets the state to normal before
> recording all the settings.


This is strange, as I certainly don't see this behaviour now (I'm
using gitk in version 1.6.4.3). Actually, I did see that behaviour
once, but I believe this was when I ran an unpatched gitk which seemed
to record wrong geometry. As soon as I cleared ~/.gitk of those wrong
coordinates I haven't seen this behaviour anymore.

On the other hand, when I resize columns and then maximize/restore the
window repeatedly I see that their sizes change in a strange way (and
the smaller restored window they stranger are results) until hitting
some sort of equilibrium, then maximize/restore doesn't have effect on
their sizes anymore. So maybe there's a bug not in a way my patch
restores the window, but in a way window resizes are handled.


> I will post an alternative patch that records the normal geometry
> whenever it changes instead which seems to work better for me.


By all means.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gitk: restore wm state to normal before saving geometry  information
  2009-09-15 12:54   ` Alexey Borzenkov
@ 2009-09-15 13:58     ` Alexey Borzenkov
  0 siblings, 0 replies; 7+ messages in thread
From: Alexey Borzenkov @ 2009-09-15 13:58 UTC (permalink / raw)
  To: Pat Thoyts; +Cc: git

On Tue, Sep 15, 2009 at 4:54 PM, Alexey Borzenkov <snaury@gmail.com> wrote:
> On the other hand, when I resize columns and then maximize/restore the
> window repeatedly I see that their sizes change in a strange way (and
> the smaller restored window they stranger are results) until hitting
> some sort of equilibrium, then maximize/restore doesn't have effect on
> their sizes anymore. So maybe there's a bug not in a way my patch
> restores the window, but in a way window resizes are handled.

It seems that I found what's the problem. When the window is very
small, and we maximize it, sash coords would initially be small. Then
we calculate their new positions and set it with $win sash place, but
unfortunately, tk limits them to the OLD pane size for some reason.
Initially I though that maybe Configure is fired too early (before
window is resized), but [winfo width $win] shows $win has the new
size. Here's some output that I got during debugging:

resizing 422 -> 1261 (winfo shows 1261)
    s0: 138 1
    s1: 288 1
    sash0: 412 -> 412 1
    sash1: 860 -> 417 1

I'm at a loss why this happens and how to lift this restriction.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gitk: restore wm state to normal before saving geometry information
  2009-09-08 19:22 Alexey Borzenkov
  2009-09-15 12:03 ` Pat Thoyts
@ 2009-09-16 10:21 ` Paul Mackerras
  2009-09-16 21:07   ` Pat Thoyts
  1 sibling, 1 reply; 7+ messages in thread
From: Paul Mackerras @ 2009-09-16 10:21 UTC (permalink / raw)
  To: Alexey Borzenkov; +Cc: git

Alexey Borzenkov writes:

> gitk now includes patches for saving and restoring wm state, however
> because it saves wm geometry when window can still be maximized the
> maximize/restore button becomes useless after restarting gitk (you
> will get a huge displaced window if you try to restore it). This
> patch fixes this issue by storing window geometry in normal state.

Hmmm, shouldn't we be also saving the window state (zoomed/normal) and
restoring that as well?

Paul.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gitk: restore wm state to normal before saving geometry information
  2009-09-16 10:21 ` Paul Mackerras
@ 2009-09-16 21:07   ` Pat Thoyts
  0 siblings, 0 replies; 7+ messages in thread
From: Pat Thoyts @ 2009-09-16 21:07 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: Alexey Borzenkov, git

Paul Mackerras <paulus@samba.org> writes:

>> patch fixes this issue by storing window geometry in normal state.
>
>Hmmm, shouldn't we be also saving the window state (zoomed/normal) and
>restoring that as well?
>
>Paul.

We do. That got added in c876dbad

-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-09-16 21:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-08 18:44 [PATCH] gitk: restore wm state to normal before saving geometry information Alexey Borzenkov
  -- strict thread matches above, loose matches on Subject: below --
2009-09-08 19:22 Alexey Borzenkov
2009-09-15 12:03 ` Pat Thoyts
2009-09-15 12:54   ` Alexey Borzenkov
2009-09-15 13:58     ` Alexey Borzenkov
2009-09-16 10:21 ` Paul Mackerras
2009-09-16 21:07   ` Pat Thoyts

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).