{"thread":{"id":"11931","subject":"Bug in gitk - can post the window off screen","startedAt":"2008-02-07T06:16:52Z","lastAt":"2008-03-10T13:17:55Z","messageCount":26,"participants":["Tommy Thorn","Shawn O. Pearce","Robin Rosenberg","Gerrit Pape","Jonathan del Strother","Paul Mackerras","Mark Levedahl","Edgar Toernig","martin f krafft","Martin Langhoff","A Large Angry SCM","David Tweed"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"67753","messageId":"47AAA254.2020008@thorn.ws","threadId":"11931","inReplyTo":null,"subject":"Bug in gitk - can post the window off screen","fromName":"Tommy Thorn","fromEmail":"tommy-git@thorn.ws","sentAt":"2008-02-07T06:16:52Z","receivedAt":"2008-02-07T06:16:52Z","isPatch":false,"sender":{"key":"tommy-git@thorn.ws","avatar":null},"body":"Just a quick heads-up: I was running a dual screen setup with gitk on my \n2nd monitor. When I later started gitk up without the 2nd monitor, the \ngitk window didn't appear. Given the time between the two sessions, it \ndidn't occur to me what the problem was.\n\nGitk should probably validate the \"set geometry(main)\" variable against \nthe current resolution.\n\nTommy\n"},{"id":"67755","messageId":"20080207063020.GP24004@spearce.org","threadId":"11931","inReplyTo":"47AAA254.2020008@thorn.ws","subject":"Re: Bug in gitk - can post the window off screen","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-02-07T06:30:20Z","receivedAt":"2008-02-07T06:30:20Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Tommy Thorn <tommy-git@thorn.ws> wrote:\n> Just a quick heads-up: I was running a dual screen setup with gitk on my \n> 2nd monitor. When I later started gitk up without the 2nd monitor, the \n> gitk window didn't appear. Given the time between the two sessions, it \n> didn't occur to me what the problem was.\n> \n> Gitk should probably validate the \"set geometry(main)\" variable against \n> the current resolution.\n\nSad to say but this is a known issue with both gitk and git-gui.\nBoth applications save the prior geometry and restore it during\nthe next run, but neither validates the new geometry makes sense\nwith the current available desktop space.  :-\\\n\n-- \nShawn.\n"},{"id":"67776","messageId":"200802071056.19370.robin.rosenberg.lists@dewire.com","threadId":"11931","inReplyTo":"20080207063020.GP24004@spearce.org","subject":"Re: Bug in gitk - can post the window off screen","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2008-02-07T09:56:19Z","receivedAt":"2008-02-07T09:56:19Z","isPatch":false,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"torsdagen den 7 februari 2008 skrev Shawn O. Pearce:\n> Tommy Thorn <tommy-git@thorn.ws> wrote:\n> > Just a quick heads-up: I was running a dual screen setup with gitk on my \n> > 2nd monitor. When I later started gitk up without the 2nd monitor, the \n> > gitk window didn't appear. Given the time between the two sessions, it \n> > didn't occur to me what the problem was.\n> > \n> > Gitk should probably validate the \"set geometry(main)\" variable against \n> > the current resolution.\n> \n> Sad to say but this is a known issue with both gitk and git-gui.\n> Both applications save the prior geometry and restore it during\n> the next run, but neither validates the new geometry makes sense\n> with the current available desktop space.  :-\\\n\nSeems KDE forces it back into visible space, but it is annoying that the \ngitk/git-gui windows do not come up on the same monitor as my cursor is on. \nCould we change it and save just size, just like \"all other\" apps?\n\n-- robin\n"},{"id":"67777","messageId":"20080207101051.19459.qmail@fcb20609bc7c07.315fe32.mid.smarden.org","threadId":"11931","inReplyTo":"200802071056.19370.robin.rosenberg.lists@dewire.com","subject":"Re: Bug in gitk - can post the window off screen","fromName":"Gerrit Pape","fromEmail":"pape@smarden.org","sentAt":"2008-02-07T10:10:51Z","receivedAt":"2008-02-07T10:10:51Z","isPatch":false,"sender":{"key":"pape@smarden.org","avatar":"https://avatars.githubusercontent.com/u/143170252?v=4"},"body":"On Thu, Feb 07, 2008 at 10:56:19AM +0100, Robin Rosenberg wrote:\n> torsdagen den 7 februari 2008 skrev Shawn O. Pearce:\n> > Tommy Thorn <tommy-git@thorn.ws> wrote:\n> > > Just a quick heads-up: I was running a dual screen setup with gitk on my \n> > > 2nd monitor. When I later started gitk up without the 2nd monitor, the \n> > > gitk window didn't appear. Given the time between the two sessions, it \n> > > didn't occur to me what the problem was.\n> > > \n> > > Gitk should probably validate the \"set geometry(main)\" variable against \n> > > the current resolution.\n> > \n> > Sad to say but this is a known issue with both gitk and git-gui.\n> > Both applications save the prior geometry and restore it during\n> > the next run, but neither validates the new geometry makes sense\n> > with the current available desktop space.  :-\\\n> \n> Seems KDE forces it back into visible space, but it is annoying that the \n> gitk/git-gui windows do not come up on the same monitor as my cursor is on. \n> Could we change it and save just size, just like \"all other\" apps?\n\nNot saving the geometry on exit was also suggested through the Debian\nBTS, \"as window placement and sizing are the task of the window\nmanager\"\n http://bugs.debian.org/442253\n\nRegards, Gerrit.\n"},{"id":"69672","messageId":"20080223113759.12854.qmail@6a8737aa4695b2.315fe32.mid.smarden.org","threadId":"11931","inReplyTo":"20080207101051.19459.qmail@fcb20609bc7c07.315fe32.mid.smarden.org","subject":"[PATCH] gitk: don't save the geometry to rc file on exit","fromName":"Gerrit Pape","fromEmail":"pape@smarden.org","sentAt":"2008-02-23T11:37:59Z","receivedAt":"2008-02-23T11:37:59Z","isPatch":true,"sender":{"key":"pape@smarden.org","avatar":"https://avatars.githubusercontent.com/u/143170252?v=4"},"body":"Saving the geometry can cause several inconveniences, e.g. when using a\ntemporary dual screen setup, or sharing ~/.gitk between multiple\nsystems.  Additionally it can be argued that window placement and sizing\nare the tasks of the window manager.  So don't do that anymore.\n\nThis has been requested by martin f krafft and Josh Triplett through\n http://bugs.debian.org/442253\n http://bugs.debian.org/467121\n\nSigned-off-by: Gerrit Pape <pape@smarden.org>\n---\n gitk-git/gitk |    8 --------\n 1 files changed, 0 insertions(+), 8 deletions(-)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex f1f21e9..8039d19 100644\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -1188,14 +1188,6 @@ proc savestuff {w} {\n \tputs $f [list set diffcontext $diffcontext]\n \tputs $f [list set selectbgcolor $selectbgcolor]\n \n-\tputs $f \"set geometry(main) [wm geometry .]\"\n-\tputs $f \"set geometry(topwidth) [winfo width .tf]\"\n-\tputs $f \"set geometry(topheight) [winfo height .tf]\"\n-        puts $f \"set geometry(pwsash0) \\\"[.tf.histframe.pwclist sash coord 0]\\\"\"\n-        puts $f \"set geometry(pwsash1) \\\"[.tf.histframe.pwclist sash coord 1]\\\"\"\n-\tputs $f \"set geometry(botwidth) [winfo width .bleft]\"\n-\tputs $f \"set geometry(botheight) [winfo height .bleft]\"\n-\n \tputs -nonewline $f \"set permviews {\"\n \tfor {set v 0} {$v < $nextviewnum} {incr v} {\n \t    if {$viewperm($v)} {\n-- \n1.5.4.2\n"},{"id":"69675","messageId":"200802231352.37934.robin.rosenberg.lists@dewire.com","threadId":"11931","inReplyTo":"20080223113759.12854.qmail@6a8737aa4695b2.315fe32.mid.smarden.org","subject":"Re: [PATCH] gitk: don't save the geometry to rc file on exit","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2008-02-23T12:52:36Z","receivedAt":"2008-02-23T12:52:36Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"lördagen den 23 februari 2008 skrev Gerrit Pape:\n> Saving the geometry can cause several inconveniences, e.g. when using a\n> temporary dual screen setup, or sharing ~/.gitk between multiple\n> systems.  Additionally it can be argued that window placement and sizing\n> are the tasks of the window manager.  So don't do that anymore.\n\nShouldn't the restoring code also be dropped then? \n\nOther than that, I agree. The Gitk current behaviour wrt dual screens \nis really inconvenient.\n\n-- robin\n"},{"id":"69678","messageId":"57518fd10802230515v2f71d6a8jcdc33fb2332ceb8f@mail.gmail.com","threadId":"11931","inReplyTo":"200802231352.37934.robin.rosenberg.lists@dewire.com","subject":"Re: [PATCH] gitk: don't save the geometry to rc file on exit","fromName":"Jonathan del Strother","fromEmail":"maillist@steelskies.com","sentAt":"2008-02-23T13:15:47Z","receivedAt":"2008-02-23T13:15:47Z","isPatch":true,"sender":{"key":"jon.delstrother@bestbefore.tv","avatar":"https://gravatar.com/avatar/754e21ab701c00e2d21fc261187254c34b2a1c0b959d9ee5be1a295990be3081?d=mp&s=160"},"body":"On Sat, Feb 23, 2008 at 12:52 PM, Robin Rosenberg\n<robin.rosenberg.lists@dewire.com> wrote:\n> lördagen den 23 februari 2008 skrev Gerrit Pape:\n>\n> > Saving the geometry can cause several inconveniences, e.g. when using a\n>  > temporary dual screen setup, or sharing ~/.gitk between multiple\n>  > systems.  Additionally it can be argued that window placement and sizing\n>  > are the tasks of the window manager.  So don't do that anymore.\n>\n>  Shouldn't the restoring code also be dropped then?\n\nPerhaps, though that would prevent you setting up default width &\nheight.  You'd always be stuck with the (too small IMO) original\nwindow size\n"},{"id":"69738","messageId":"18368.41742.689290.877767@cargo.ozlabs.ibm.com","threadId":"11931","inReplyTo":"20080223113759.12854.qmail@6a8737aa4695b2.315fe32.mid.smarden.org","subject":"Re: [PATCH] gitk: don't save the geometry to rc file on exit","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2008-02-23T22:49:50Z","receivedAt":"2008-02-23T22:49:50Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"Gerrit Pape writes:\n\n> Saving the geometry can cause several inconveniences, e.g. when using a\n> temporary dual screen setup, or sharing ~/.gitk between multiple\n> systems.  Additionally it can be argued that window placement and sizing\n> are the tasks of the window manager.  So don't do that anymore.\n\nI myself find it useful to have gitk remember the size and layout of\nthe various panes, so I won't be applying this patch.\n\nThe saving/restoring of the window position was done by Mark Levedahl\nto make gitk work properly on Cygwin.  I agree it can be annoying on X\nand I would take a patch to inhibit the restoring of the window\nposition when running under X.  I'd want an ack from Mark before\nmaking that change more generally.\n\nPaul.\n"},{"id":"69797","messageId":"47C190E3.6000407@gmail.com","threadId":"11931","inReplyTo":"18368.41742.689290.877767@cargo.ozlabs.ibm.com","subject":"Re: [PATCH] gitk: don't save the geometry to rc file on exit","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2008-02-24T15:44:35Z","receivedAt":"2008-02-24T15:44:35Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Paul Mackerras wrote:\n> Gerrit Pape writes:\n>\n>   \n>> Saving the geometry can cause several inconveniences, e.g. when using a\n>> temporary dual screen setup, or sharing ~/.gitk between multiple\n>> systems.  Additionally it can be argued that window placement and sizing\n>> are the tasks of the window manager.  So don't do that anymore.\n>>     \n>\n> I myself find it useful to have gitk remember the size and layout of\n> the various panes, so I won't be applying this patch.\n>\n> The saving/restoring of the window position was done by Mark Levedahl\n> to make gitk work properly on Cygwin.  I agree it can be annoying on X\n> and I would take a patch to inhibit the restoring of the window\n> position when running under X.  I'd want an ack from Mark before\n> making that change more generally.\n>\n> Paul.\n>\n>   \nI can only offer to test the proposed patch, I am unable to predict what \nwill or won't trip up the buggy geometry engine in Cygwin's Tk. I do \nremember I had trouble finding a way to restore the size but not the \nposition of the main window on Cygwin: that doesn't mean it can't be \ndone (logically, it should be easy), just that I didn't find the right \nspell or incantation that would work. I'll also admit to not having \ntried after I got to a completely working geometry solution, so perhaps \njust restoring the size without position will now work on Cygwin.\n\nUsing the saved panel sizes in conjunction with the default window size \nyields an unusable screen: many elements are obscured. The same occurs \nusing the defaults altogether: either way the user must resize and \nadjust things to get to a workable layout. So, I am very opposed to \ndisabling the memory altogether. Also, I have a number of X apps that \nremember their layout, so gitk's current behavior is not (at least to \nme) an aberration and I would like that behavior to at least remain an \noption.\n\nMark\n"},{"id":"69808","messageId":"20080224192107.323a6abc.froese@gmx.de","threadId":"11931","inReplyTo":"47C190E3.6000407@gmail.com","subject":"Re: [PATCH] gitk: don't save the geometry to rc file on exit","fromName":"Edgar Toernig","fromEmail":"froese@gmx.de","sentAt":"2008-02-24T18:21:07Z","receivedAt":"2008-02-24T18:21:07Z","isPatch":true,"sender":{"key":"froese@gmx.de","avatar":null},"body":"Mark Levedahl wrote:\n>\n> [...] so gitk's current behavior is not (at least to me) an aberration\n> and I would like that behavior to at least remain an option.\n\nIt would be really annoying if I had to resize and reconfigure (the\npanes) each time I start gitk.\n\nHow about only taking the saved geometry/fonts/etc when the screen\nsize hasn't changed?\n\nThe easiest method (for a Tcl-noob like me) would be to wrap the\n\"set geometry...\" in .gitk with an if-statement which checks the\nscreen size.\n\nSomething like this:\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex 5560e4d..1c572c9 100644\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -1158,14 +1158,12 @@ proc savestuff {w} {\n     global viewname viewfiles viewargs viewperm nextviewnum\n     global cmitmode wrapcomment datetimeformat limitdiffs\n     global colors bgcolor fgcolor diffcolors diffcontext selectbgcolor\n+    global screen_size\n \n     if {$stuffsaved} return\n     if {![winfo viewable .]} return\n     catch {\n \tset f [open \"~/.gitk-new\" w]\n-\tputs $f [list set mainfont $mainfont]\n-\tputs $f [list set textfont $textfont]\n-\tputs $f [list set uifont $uifont]\n \tputs $f [list set tabstop $tabstop]\n \tputs $f [list set findmergefiles $findmergefiles]\n \tputs $f [list set maxgraphpct $maxgraphpct]\n@@ -1183,6 +1181,10 @@ proc savestuff {w} {\n \tputs $f [list set diffcontext $diffcontext]\n \tputs $f [list set selectbgcolor $selectbgcolor]\n \n+\tputs $f \"if {\\$screen_size == \\\"$screen_size\\\"} {\"\n+\tputs $f [list set mainfont $mainfont]\n+\tputs $f [list set textfont $textfont]\n+\tputs $f [list set uifont $uifont]\n \tputs $f \"set geometry(main) [wm geometry .]\"\n \tputs $f \"set geometry(topwidth) [winfo width .tf]\"\n \tputs $f \"set geometry(topheight) [winfo height .tf]\"\n@@ -1198,6 +1200,7 @@ proc savestuff {w} {\n \t    }\n \t}\n \tputs $f \"}\"\n+\tputs $f \"}\"\n \tclose $f\n \tfile rename -force \"~/.gitk-new\" \"~/.gitk\"\n     }\n@@ -8461,6 +8464,8 @@ set diffcolors {red \"#00a000\" blue}\n set diffcontext 3\n set selectbgcolor gray85\n \n+set screen_size [winfo screenwidth .]x[winfo screenheight .]\n+\n ## For msgcat loading, first locate the installation location.\n if { [info exists ::env(GITK_MSGSDIR)] } {\n     ## Msgsdir was manually set in the environment.\n\nSaving geometries for multiple screen sizes would be even better\n(i.e. geometry_1440x900(main) etc or an additional \".gitk-$screen_size\"\nfor the geometry data) but that is beyond my Tcl-skills.\n\nCiao, ET.\n"},{"id":"69867","messageId":"20080225080739.GA13610@piper.oerlikon.madduck.net","threadId":"11931","inReplyTo":"18368.41742.689290.877767@cargo.ozlabs.ibm.com","subject":"Re: [PATCH] gitk: don't save the geometry to rc file on exit","fromName":"martin f krafft","fromEmail":"madduck@madduck.net","sentAt":"2008-02-25T08:07:39Z","receivedAt":"2008-02-25T08:07:39Z","isPatch":true,"sender":{"key":"madduck@madduck.net","avatar":null},"body":"also sprach Paul Mackerras <paulus@samba.org> [2008.02.23.2349 +0100]:\n> > Saving the geometry can cause several inconveniences, e.g. when\n> > using a temporary dual screen setup, or sharing ~/.gitk between\n> > multiple systems.  Additionally it can be argued that window\n> > placement and sizing are the tasks of the window manager.  So\n> > don't do that anymore.\n> \n> I myself find it useful to have gitk remember the size and layout\n> of the various panes, so I won't be applying this patch.\n> \n> The saving/restoring of the window position was done by Mark\n> Levedahl to make gitk work properly on Cygwin.  I agree it can be\n> annoying on X and I would take a patch to inhibit the restoring of\n> the window position when running under X.  I'd want an ack from\n> Mark before making that change more generally.\n\nMay I suggest that such a patch actually disables writing of the\nconfig file, so that we won't get conflicts every time you sync\nconfig files via home-in-git?\n\nOf course I offer to look into this once Mark approves.\n\n-- \nmartin | http://madduck.net/ | http://two.sentenc.es/\n \n\"if there's anything more important than my ego,\n i want it caught and shot now.\"\n                                                -- zaphod beeblebrox\n \nspamtraps: madduck.bogus@madduck.net\n"},{"id":"69879","messageId":"18370.45020.940192.10482@cargo.ozlabs.ibm.com","threadId":"11931","inReplyTo":"20080225080739.GA13610@piper.oerlikon.madduck.net","subject":"Re: [PATCH] gitk: don't save the geometry to rc file on exit","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2008-02-25T12:09:00Z","receivedAt":"2008-02-25T12:09:00Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"martin f krafft writes:\n\n> May I suggest that such a patch actually disables writing of the\n> config file, so that we won't get conflicts every time you sync\n> config files via home-in-git?\n\nThen various other bits of config won't be persistent, such as font\nsettings.  So I don't think that's a good idea.\n\nIt would be possible to make the config file be per-repository rather\nthan global, I guess, if that is something people want.  I personally\nwould find it annoying to have to change the font separately in each\nrepository, but tastes differ, I guess.\n\nPaul.\n"},{"id":"69880","messageId":"20080225122443.GA1543@piper.oerlikon.madduck.net","threadId":"11931","inReplyTo":"18370.45020.940192.10482@cargo.ozlabs.ibm.com","subject":"Re: [PATCH] gitk: don't save the geometry to rc file on exit","fromName":"martin f krafft","fromEmail":"madduck@madduck.net","sentAt":"2008-02-25T12:24:43Z","receivedAt":"2008-02-25T12:24:43Z","isPatch":true,"sender":{"key":"madduck@madduck.net","avatar":null},"body":"also sprach Paul Mackerras <paulus@samba.org> [2008.02.25.1309 +0100]:\n> Then various other bits of config won't be persistent, such as font\n> settings.  So I don't think that's a good idea.\n\nHuh? I use the same font on all machines, but the screen resolutions\ndiffer...\n\n-- \nmartin | http://madduck.net/ | http://two.sentenc.es/\n \ntime wounds all heels.\n                                                       -- groucho marx\n \nspamtraps: madduck.bogus@madduck.net\n"},{"id":"69884","messageId":"30e4a070802250535g72b59106yb1e4478eb9b9f47a@mail.gmail.com","threadId":"11931","inReplyTo":"18370.45020.940192.10482@cargo.ozlabs.ibm.com","subject":"Re: [PATCH] gitk: don't save the geometry to rc file on exit","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2008-02-25T13:35:43Z","receivedAt":"2008-02-25T13:35:43Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"On Mon, Feb 25, 2008 at 7:09 AM, Paul Mackerras <paulus@samba.org> wrote:\n> martin f krafft writes:\n>\n>  > May I suggest that such a patch actually disables writing of the\n>  > config file, so that we won't get conflicts every time you sync\n>  > config files via home-in-git?\n>\n>  Then various other bits of config won't be persistent, such as font\n>  settings.  So I don't think that's a good idea.\n>\n>  It would be possible to make the config file be per-repository rather\n>  than global, I guess, if that is something people want.  I personally\n>  would find it annoying to have to change the font separately in each\n>  repository, but tastes differ, I guess.\n>\n>  Paul.\n>\nTwo things we could do:\n\n1) Add a \"save config now\" button and a \"save config on exit\"\ncheckbox/option to the options dialog.\n2) Perform a screen geometry check at load time to see if the corners\nof the main window would be visible before applying the main window\ngeometry.\n\nMark\n"},{"id":"69885","messageId":"20080225141516.GA9391@piper.oerlikon.madduck.net","threadId":"11931","inReplyTo":"30e4a070802250535g72b59106yb1e4478eb9b9f47a@mail.gmail.com","subject":"Re: [PATCH] gitk: don't save the geometry to rc file on exit","fromName":"martin f krafft","fromEmail":"madduck@madduck.net","sentAt":"2008-02-25T14:15:16Z","receivedAt":"2008-02-25T14:15:16Z","isPatch":true,"sender":{"key":"madduck@madduck.net","avatar":null},"body":"also sprach Mark Levedahl <mlevedahl@gmail.com> [2008.02.25.1435 +0100]:\n> 1) Add a \"save config now\" button and a \"save config on exit\"\n> checkbox/option to the options dialog.\n\nand a checkbox like \"disable writing window geometry data to the\nconfiguration file\"\n\n> 2) Perform a screen geometry check at load time to see if the corners\n> of the main window would be visible before applying the main window\n> geometry.\n\nI don't see the benefit of this. I really rather believe that window\ngeometry is the job of the window manager. If Cygwin needs it, then\nmaybe it could be conditionally compiled on that platform.\n\n-- \nmartin | http://madduck.net/ | http://two.sentenc.es/\n \nquantum mechanics: the dreams stuff is made of.\n \nspamtraps: madduck.bogus@madduck.net\n"},{"id":"69912","messageId":"46a038f90802251159j591c16c2g1e5b5aa20e9edb00@mail.gmail.com","threadId":"11931","inReplyTo":"30e4a070802250535g72b59106yb1e4478eb9b9f47a@mail.gmail.com","subject":"Re: [PATCH] gitk: don't save the geometry to rc file on exit","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2008-02-25T19:59:43Z","receivedAt":"2008-02-25T19:59:43Z","isPatch":true,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On Tue, Feb 26, 2008 at 2:35 AM, Mark Levedahl <mlevedahl@gmail.com> wrote:\n>  2) Perform a screen geometry check at load time to see if the corners\n>  of the main window would be visible before applying the main window\n>  geometry.\n\nAs a multi-screen-layouts, multi-machine user, this approach has my\nvote. I see a proto-patch from Edgar too. Even if the wm has similar\ncapabilities, those will be limited to main window geometry, not\ninner-panel geometry so this is still useful.\n\ncheers,\n\n\nm\n"},{"id":"69941","messageId":"200802260008.36360.robin.rosenberg.lists@dewire.com","threadId":"11931","inReplyTo":"46a038f90802251159j591c16c2g1e5b5aa20e9edb00@mail.gmail.com","subject":"Re: [PATCH] gitk: don't save the geometry to rc file on exit","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2008-02-25T23:08:34Z","receivedAt":"2008-02-25T23:08:34Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"måndagen den 25 februari 2008 skrev Martin Langhoff:\n> On Tue, Feb 26, 2008 at 2:35 AM, Mark Levedahl <mlevedahl@gmail.com> wrote:\n> >  2) Perform a screen geometry check at load time to see if the corners\n> >  of the main window would be visible before applying the main window\n> >  geometry.\n> \n> As a multi-screen-layouts, multi-machine user, this approach has my\n> vote. I see a proto-patch from Edgar too. Even if the wm has similar\n> capabilities, those will be limited to main window geometry, not\n> inner-panel geometry so this is still useful.\n\nThe annoying part is that it remembers the position. Remembering siz\nI can live with, but I don't want it popping up the wrong screen.\n\n-- robin\n"},{"id":"69956","messageId":"47C37647.90908@gmail.com","threadId":"11931","inReplyTo":"18368.41742.689290.877767@cargo.ozlabs.ibm.com","subject":"Re: [PATCH] gitk: don't save the geometry to rc file on exit","fromName":"A Large Angry SCM","fromEmail":"gitzilla@gmail.com","sentAt":"2008-02-26T02:15:35Z","receivedAt":"2008-02-26T02:15:35Z","isPatch":true,"sender":{"key":"gitzilla@gmail.com","avatar":"https://gravatar.com/avatar/354625c442439908ff3dd99757dee330e29e9df7847472384faf7a00add247fb?d=mp&s=160"},"body":"Paul Mackerras wrote:\n> Gerrit Pape writes:\n> \n>> Saving the geometry can cause several inconveniences, e.g. when using a\n>> temporary dual screen setup, or sharing ~/.gitk between multiple\n>> systems.  Additionally it can be argued that window placement and sizing\n>> are the tasks of the window manager.  So don't do that anymore.\n> \n> I myself find it useful to have gitk remember the size and layout of\n> the various panes, so I won't be applying this patch.\n> \n> The saving/restoring of the window position was done by Mark Levedahl\n> to make gitk work properly on Cygwin.  I agree it can be annoying on X\n> and I would take a patch to inhibit the restoring of the window\n> position when running under X.  I'd want an ack from Mark before\n> making that change more generally.\n\nI use gitk under X and like the saving/restoring of window \nsize/geometry. Please do not remove that feature.\n"},{"id":"71241","messageId":"18383.57540.26282.526111@cargo.ozlabs.ibm.com","threadId":"11931","inReplyTo":"47C190E3.6000407@gmail.com","subject":"Re: [PATCH] gitk: don't save the geometry to rc file on exit","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2008-03-06T12:17:08Z","receivedAt":"2008-03-06T12:17:08Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"Mark Levedahl writes:\n\n> I can only offer to test the proposed patch, I am unable to predict what \n> will or won't trip up the buggy geometry engine in Cygwin's Tk. I do \n> remember I had trouble finding a way to restore the size but not the \n> position of the main window on Cygwin: that doesn't mean it can't be \n> done (logically, it should be easy), just that I didn't find the right \n> spell or incantation that would work. I'll also admit to not having \n> tried after I got to a completely working geometry solution, so perhaps \n> just restoring the size without position will now work on Cygwin.\n> \n> Using the saved panel sizes in conjunction with the default window size \n> yields an unusable screen: many elements are obscured. The same occurs \n> using the defaults altogether: either way the user must resize and \n> adjust things to get to a workable layout. So, I am very opposed to \n> disabling the memory altogether. Also, I have a number of X apps that \n> remember their layout, so gitk's current behavior is not (at least to \n> me) an aberration and I would like that behavior to at least remain an \n> option.\n\nHere's a patch for people to test.  It only restores the width and\nheight, and limits the width and height to be at most the width and\nheight of the screen.  It seems to work fine under X; I would be\ninterested to know what happens under macos and windows.\n\nPaul.\n---\ndiff --git a/gitk b/gitk\nindex f1f21e9..f8f006f 100755\n--- a/gitk\n+++ b/gitk\n@@ -930,9 +930,17 @@ proc makewindow {} {\n     .pwbottom add .bright\n     .ctop add .pwbottom\n \n-    # restore window position if known\n+    # restore window width & height if known\n     if {[info exists geometry(main)]} {\n-        wm geometry . \"$geometry(main)\"\n+\tif {[scan $geometry(main) \"%dx%d\" w h] >= 2} {\n+\t    if {$w > [winfo screenwidth .]} {\n+\t\tset w [winfo screenwidth .]\n+\t    }\n+\t    if {$h > [winfo screenheight .]} {\n+\t\tset h [winfo screenheight .]\n+\t    }\n+\t    wm geometry . \"${w}x$h\"\n+\t}\n     }\n \n     if {[tk windowingsystem] eq {aqua}} {\n\n"},{"id":"71247","messageId":"57518fd10803060459m6e3ffc00n388721ad2e5975ad@mail.gmail.com","threadId":"11931","inReplyTo":"18383.57540.26282.526111@cargo.ozlabs.ibm.com","subject":"Re: [PATCH] gitk: don't save the geometry to rc file on exit","fromName":"Jonathan del Strother","fromEmail":"maillist@steelskies.com","sentAt":"2008-03-06T12:59:24Z","receivedAt":"2008-03-06T12:59:24Z","isPatch":true,"sender":{"key":"jon.delstrother@bestbefore.tv","avatar":"https://gravatar.com/avatar/754e21ab701c00e2d21fc261187254c34b2a1c0b959d9ee5be1a295990be3081?d=mp&s=160"},"body":"On Thu, Mar 6, 2008 at 12:17 PM, Paul Mackerras <paulus@samba.org> wrote:\n> Mark Levedahl writes:\n>\n>  > I can only offer to test the proposed patch, I am unable to predict what\n>  > will or won't trip up the buggy geometry engine in Cygwin's Tk. I do\n>  > remember I had trouble finding a way to restore the size but not the\n>  > position of the main window on Cygwin: that doesn't mean it can't be\n>  > done (logically, it should be easy), just that I didn't find the right\n>  > spell or incantation that would work. I'll also admit to not having\n>  > tried after I got to a completely working geometry solution, so perhaps\n>  > just restoring the size without position will now work on Cygwin.\n>  >\n>  > Using the saved panel sizes in conjunction with the default window size\n>  > yields an unusable screen: many elements are obscured. The same occurs\n>  > using the defaults altogether: either way the user must resize and\n>  > adjust things to get to a workable layout. So, I am very opposed to\n>  > disabling the memory altogether. Also, I have a number of X apps that\n>  > remember their layout, so gitk's current behavior is not (at least to\n>  > me) an aberration and I would like that behavior to at least remain an\n>  > option.\n>\n>  Here's a patch for people to test.  It only restores the width and\n>  height, and limits the width and height to be at most the width and\n>  height of the screen.  It seems to work fine under X; I would be\n>  interested to know what happens under macos and windows.\n>\n>  Paul.\n>  ---\n>  diff --git a/gitk b/gitk\n>  index f1f21e9..f8f006f 100755\n>  --- a/gitk\n>  +++ b/gitk\n>  @@ -930,9 +930,17 @@ proc makewindow {} {\n>      .pwbottom add .bright\n>      .ctop add .pwbottom\n>\n>  -    # restore window position if known\n>  +    # restore window width & height if known\n>      if {[info exists geometry(main)]} {\n>  -        wm geometry . \"$geometry(main)\"\n>  +       if {[scan $geometry(main) \"%dx%d\" w h] >= 2} {\n>  +           if {$w > [winfo screenwidth .]} {\n>  +               set w [winfo screenwidth .]\n>  +           }\n>  +           if {$h > [winfo screenheight .]} {\n>  +               set h [winfo screenheight .]\n>  +           }\n>  +           wm geometry . \"${w}x$h\"\n>  +       }\n>      }\n>\n>      if {[tk windowingsystem] eq {aqua}} {\n>\n>  --\n>\n\n\nThis almost works on OS X.  The only problem is that it's not taking\ninto account menubars and windowbars.  eg, if I have a screen\nresolution of 640x480, setting the window _content_ to that size will\nmake the entire window including its titlebar about 500px tall.  Not\nonly that, but the system-wide menubar at the top of the screen also\nreduces the available space, meaning that the maximum window size\nought to be around 640x456.  (If you wanted to get even pickier, that\nwill changing depending on the interface resolution...)\n\nPresumably your patch does nothing to move gitk back on screen if the\nmonitor it was on last time has gone away?  Or are we still blaming\nthe window manager for that?\n"},{"id":"71290","messageId":"18384.31184.663885.595827@cargo.ozlabs.ibm.com","threadId":"11931","inReplyTo":"57518fd10803060459m6e3ffc00n388721ad2e5975ad@mail.gmail.com","subject":"Re: [PATCH] gitk: don't save the geometry to rc file on exit","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2008-03-06T23:10:08Z","receivedAt":"2008-03-06T23:10:08Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"Jonathan del Strother writes:\n\n> This almost works on OS X.  The only problem is that it's not taking\n> into account menubars and windowbars.  eg, if I have a screen\n> resolution of 640x480, setting the window _content_ to that size will\n> make the entire window including its titlebar about 500px tall.  Not\n> only that, but the system-wide menubar at the top of the screen also\n> reduces the available space, meaning that the maximum window size\n> ought to be around 640x456.  (If you wanted to get even pickier, that\n> will changing depending on the interface resolution...)\n\nDo you know of any way for an application to determine how big it can\nbe, then?\n\n> Presumably your patch does nothing to move gitk back on screen if the\n> monitor it was on last time has gone away?  Or are we still blaming\n> the window manager for that?\n\nWith the patch it no longer specifies a position, so yes we blame the\nwindow manager now if it doesn't put the window somewhere visible. :)\n\nPaul.\n"},{"id":"71315","messageId":"47D0B098.9040707@gmail.com","threadId":"11931","inReplyTo":"18383.57540.26282.526111@cargo.ozlabs.ibm.com","subject":"Re: [PATCH] gitk: don't save the geometry to rc file on exit","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2008-03-07T03:03:52Z","receivedAt":"2008-03-07T03:03:52Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Paul Mackerras wrote:\n> Here's a patch for people to test.  It only restores the width and\n> height, and limits the width and height to be at most the width and\n> height of the screen.  It seems to work fine under X; I would be\n> interested to know what happens under macos and windows.\n>\n> Paul.\n> ---\n> diff --git a/gitk b/gitk\n> index f1f21e9..f8f006f 100755\n> --- a/gitk\n> +++ b/gitk\n> @@ -930,9 +930,17 @@ proc makewindow {} {\n>      .pwbottom add .bright\n>      .ctop add .pwbottom\n>  \n> -    # restore window position if known\n> +    # restore window width & height if known\n>      if {[info exists geometry(main)]} {\n> -        wm geometry . \"$geometry(main)\"\n> +\tif {[scan $geometry(main) \"%dx%d\" w h] >= 2} {\n> +\t    if {$w > [winfo screenwidth .]} {\n> +\t\tset w [winfo screenwidth .]\n> +\t    }\n> +\t    if {$h > [winfo screenheight .]} {\n> +\t\tset h [winfo screenheight .]\n> +\t    }\n> +\t    wm geometry . \"${w}x$h\"\n> +\t}\n>      }\n>  \n>      if {[tk windowingsystem] eq {aqua}} {\n>   \nThis works fine on Cygwin: the size restores properly across sessions, \nthe window and widgets all behave as expected. So, you can add a  \n\"Tested-by: Mark Levedahl <mlevedahl@gmail.com\" if you wish to this.\n\nMark\n"},{"id":"71331","messageId":"20080307111144.GA18108@piper.oerlikon.madduck.net","threadId":"11931","inReplyTo":"18383.57540.26282.526111@cargo.ozlabs.ibm.com","subject":"Re: [PATCH] gitk: don't save the geometry to rc file on exit","fromName":"martin f krafft","fromEmail":"madduck@madduck.net","sentAt":"2008-03-07T11:11:44Z","receivedAt":"2008-03-07T11:11:44Z","isPatch":true,"sender":{"key":"madduck@madduck.net","avatar":null},"body":"also sprach Paul Mackerras <paulus@samba.org> [2008.03.06.1317 +0100]:\n> Here's a patch for people to test.  It only restores the width and\n> height, and limits the width and height to be at most the width and\n> height of the screen.  It seems to work fine under X; I would be\n> interested to know what happens under macos and windows.\n\nI can confirm that the behaviour is much better: the window size is\nrestored, as is the position, but it gives preference to the\nXinerama head. You'd think it restores at the same *relative*\nposition on the current head, but it actually just restores\nsomewhere — I cannot figure out the behaviour.\n\nHowever, I still wonder why we have to do this at all. I understand\nthat Cygwin has issues and needs this code, but couldn't it then be\nmade to run only on Cygwin, such that on \"proper\" Unix systems, the\nconfig file is *not* updated every time I move the window before\nclosing the application? As I said earlier, this is really the job\nof a window manager, *not* a configuration option. If your window\nmanager cannot restore the window to a size you control, then it's\nbroken. Let's not hack applications to work around that, please.\n\n-- \nmartin | http://madduck.net/ | http://two.sentenc.es/\n \n$complex->{'data'}[$structures][$in_perl] = @{$can{'be'}->[$painful]};\n \nspamtraps: madduck.bogus@madduck.net\n"},{"id":"71546","messageId":"18386.29775.512557.202621@cargo.ozlabs.ibm.com","threadId":"11931","inReplyTo":"20080307111144.GA18108@piper.oerlikon.madduck.net","subject":"Re: [PATCH] gitk: don't save the geometry to rc file on exit","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2008-03-08T11:11:11Z","receivedAt":"2008-03-08T11:11:11Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"martin f krafft writes:\n\n> I can confirm that the behaviour is much better: the window size is\n> restored, as is the position, but it gives preference to the\n> Xinerama head. You'd think it restores at the same *relative*\n> position on the current head, but it actually just restores\n> somewhere \u001b$,1rt\u001b(B I cannot figure out the behaviour.\n\nThe position is entirely up to your window manager.\n\n> However, I still wonder why we have to do this at all.\n\nWell, try it without... :)\n\nRestoring the overall window size and the positions of the sashes of\nthe panedwindows is the simplest and most reliable method I have found\nfor making the window come back the way the user last set it.\n\n> I understand\n> that Cygwin has issues and needs this code, but couldn't it then be\n> made to run only on Cygwin, such that on \"proper\" Unix systems, the\n> config file is *not* updated every time I move the window before\n> closing the application?\n\nWhat's the issue with updating the config file?\n\n> As I said earlier, this is really the job\n> of a window manager, *not* a configuration option. If your window\n> manager cannot restore the window to a size you control, then it's\n> broken. Let's not hack applications to work around that, please.\n\nI disagree.  It's not a window manager's job to tell an application\nhow big its window should be.\n\nPaul.\n"},{"id":"71576","messageId":"20080310112923.GA21252@piper.oerlikon.madduck.net","threadId":"11931","inReplyTo":"18386.29775.512557.202621@cargo.ozlabs.ibm.com","subject":"Re: [PATCH] gitk: don't save the geometry to rc file on exit","fromName":"martin f krafft","fromEmail":"madduck@madduck.net","sentAt":"2008-03-10T11:29:23Z","receivedAt":"2008-03-10T11:29:23Z","isPatch":true,"sender":{"key":"madduck@madduck.net","avatar":null},"body":"also sprach Paul Mackerras <paulus@samba.org> [2008.03.08.1211 +0100]:\n> > I understand that Cygwin has issues and needs this code, but\n> > couldn't it then be made to run only on Cygwin, such that on\n> > \"proper\" Unix systems, the config file is *not* updated every\n> > time I move the window before closing the application?\n> \n> What's the issue with updating the config file?\n\nConflicts when synchronising the files between different machines,\nor the need for a custom merge driver just for .gitkrc files.\n\n> > As I said earlier, this is really the job of a window manager,\n> > *not* a configuration option. If your window manager cannot\n> > restore the window to a size you control, then it's broken.\n> > Let's not hack applications to work around that, please.\n> \n> I disagree.  It's not a window manager's job to tell an\n> application how big its window should be.\n\nI always assumed it was: position and geometry. However, I am\nstarting to see your point.\n\nI guess the best way would be a checkbox with which I can disable\nthe saving of the geometry on application close, possibly paired\nwith a button \"save now\".\n\n-- \nmartin | http://madduck.net/ | http://two.sentenc.es/\n \nan egg has the shortest sex-life of all: if gets laid once; it gets\neaten once. it also has to come in a box with 11 others, and the\nonly person who will sit on its face is its mother.\n \nspamtraps: madduck.bogus@madduck.net\n"},{"id":"71582","messageId":"e1dab3980803100617n61429036w7dbbeab1f535dd39@mail.gmail.com","threadId":"11931","inReplyTo":"18386.29775.512557.202621@cargo.ozlabs.ibm.com","subject":"Re: [PATCH] gitk: don't save the geometry to rc file on exit","fromName":"David Tweed","fromEmail":"david.tweed@gmail.com","sentAt":"2008-03-10T13:17:55Z","receivedAt":"2008-03-10T13:17:55Z","isPatch":true,"sender":{"key":"david.tweed@gmail.com","avatar":null},"body":"2008/3/8 Paul Mackerras <paulus@samba.org>:\n>  > As I said earlier, this is really the job\n>  > of a window manager, *not* a configuration option. If your window\n>  > manager cannot restore the window to a size you control, then it's\n>  > broken. Let's not hack applications to work around that, please.\n>\n>  I disagree.  It's not a window manager's job to tell an application\n>  how big its window should be.\n\nThere are some modestly popular tiling window managers that attempt to\nremove the bother of having to manually move windows around which take\nthe view that the window manager's decisions should only be overruled\nin the very rare cases where it's absolutely necessary, eg,\n\nIon http://modeemi.fi/~tuomov/ion/\ndwm http://www.suckless.org/wiki/dwm\n\n(The major windows that don't resize well are from image based\nprograms where you want exactly the underlying image on your display.\nText based programs like gitk work great under autoresizing.) However,\nthe current gitk appears to work fine on those window managers because\nthe internal dividers get automtatically resized whenever the global\nwindow resizes, and the wm resizes the window so quickly after\ncreation I don't have time to notice it.\n\n-- \ncheers, dave tweed__________________________\ndavid.tweed@gmail.com\nRm 124, School of Systems Engineering, University of Reading.\n\"while having code so boring anyone can maintain it, use Python.\" --\nattempted insult seen on slashdot\n"}]}