What do you get from $mw->winfo('geometry') ?
With the code as posted replacing $mw->geometry with no parameters with $mw->winfo('geometry') and requesting $mw->geometry('+10+0') I got:
init geometry=497x32+10+57,rootx=10,rooty=57;height:32.00
exit geometry=497x32+10+57,rootx=10,rooty=57;height:32.00
I have no doubt the nudge(+57) it got relates to the Ubuntu task bar at top of screen.
I changed the requested geometry to '+100+150' to ensure well away from the edges/bars and got:
init geometry=497x32+100+180,rootx=100,rooty=180;height:32.00
exit geometry=497x32+100+180,rootx=100,rooty=180;height:32.00
In this case the nudge is '+30'.
The problem of course being/remaining is saving the window coordinates as returned via either $mw->geometry or $mw->winfo('geometry') and attempting to reuse them at start of the next app run means the window will basically be offset and this would be cumulative unless some adjustment made on my part - but that adjustment is unlikely to be one size fits all.
Again thanks for your time and efforts. I however, believe the return on effort for providing that ability in my case is not worth it and the user will just have to move the window themselves each session - FYI undecorated windows, while not having this problem, have another which is if the user moves the window to cover the system task bar (which they cannot do with a decorated one), they cannot move it back if there is nothing to 'grab' i.e. the window fits within the task bar (so I don't let that happen).


In reply to Re^4: Tk geometry unexpected return if window withdrawn and re-instated by WayneRas
in thread Tk geometry unexpected return if window withdrawn and re-instated by WayneRas

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.