Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ Bug reports
➜ WindowPosition does not update miniwindow coordinates until after next repaint
|
WindowPosition does not update miniwindow coordinates until after next repaint
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Fiendish
USA (2,551 posts) Bio
Global Moderator |
| Date
| Tue 04 Sep 2012 02:07 AM (UTC) Amended on Tue 04 Sep 2012 02:16 AM (UTC) by Fiendish
|
| Message
| (discovered because of the new movewindow position saving changes)
WindowPosition does not update miniwindow coordinates right away. So any references to WindowInfo(win, 10) or WindowInfo(win, 11) are incorrect thereafter until something like a repaint happens.
This of course means that moving and then saving the new position does not work. |
https://github.com/fiendish/aardwolfclientpackage | | Top |
|
| Posted by
| Nick Gammon
Australia (23,166 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Tue 04 Sep 2012 09:16 AM (UTC) |
| Message
| The coordinates, some of them at least, depend on where the window is painted. For example, all of the "centering" operations, eg.
Quote:
The other positions (5, 7, 9, 11) are used for centering the window between the corners. MUSHclient tries to fit the miniwindow exactly in the middle between any corner windows. Also, if more than one window is designated as centered on that side (eg., the right side) it tries to fit them all in, evenly spaced.
The actual coordinates are discovered when the window is painted. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Fiendish
USA (2,551 posts) Bio
Global Moderator |
| Date
| Reply #2 on Tue 04 Sep 2012 12:50 PM (UTC) Amended on Tue 04 Sep 2012 12:53 PM (UTC) by Fiendish
|
| Message
| | This applies to absolute positioning as well? It seems a bit weird. I imagine miniwindows as being some virtual thing with a position that just gets drawn every once in a while. |
https://github.com/fiendish/aardwolfclientpackage | | Top |
|
| Posted by
| Nick Gammon
Australia (23,166 posts) Bio
Forum Administrator |
| Date
| Reply #3 on Tue 04 Sep 2012 11:05 PM (UTC) |
| Message
| The updating of those "info" fields is done in one place, if that is what you mean. And since some of them are dynamic (it depends which windows are active at the time of the redraw, the output window size etc.) it has to be done at paint time.
Quote:
I imagine miniwindows as being some virtual thing ...
Not sure what you mean by that. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Fiendish
USA (2,551 posts) Bio
Global Moderator |
| Date
| Reply #4 on Tue 04 Sep 2012 11:51 PM (UTC) |
| Message
|
Quote: Not sure what you mean by that.
Ah, I mean...uhh...
Your house has a certain position even if you walk home with your eyes closed. :D
It is strange to me that the position should be determined by drawing, rather than the other way around. |
https://github.com/fiendish/aardwolfclientpackage | | Top |
|
| Posted by
| Nick Gammon
Australia (23,166 posts) Bio
Forum Administrator |
| Date
| Reply #5 on Wed 05 Sep 2012 12:09 AM (UTC) |
| Message
| Think of Schrödinger's cat.
The miniwindow doesn't have a known position until you "look" at it, that is, draw it.
Otherwise every time you resized the output window, or created or destroyed a miniwindow, or enabled or disabled its "show" flag, you would have to run around recomputing all of the positions for every miniwindow, in order to satisfy your requirement that the WindowInfo works "all the time".
But even then you have only moved the problem. Say you do a WindowInfo, get the window's (intended) position, and then the main output window is resized before it is drawn, your information is still out of date. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Fiendish
USA (2,551 posts) Bio
Global Moderator |
| Date
| Reply #6 on Wed 05 Sep 2012 12:45 AM (UTC) Amended on Wed 05 Sep 2012 12:46 AM (UTC) by Fiendish
|
| Message
| | As long as you think it makes sense. Is this documented somewhere? I don't recall seeing this detail in WindowPosition help. |
https://github.com/fiendish/aardwolfclientpackage | | Top |
|
| Posted by
| Nick Gammon
Australia (23,166 posts) Bio
Forum Administrator |
| Date
| Reply #7 on Wed 05 Sep 2012 01:57 AM (UTC) |
| Message
| The documentation for WindowInfo (the function you are querying) says:
Quote:
InfoType 10 to 13 are where the auto positioning last placed the window (the last time the main screen was refreshed).
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Fiendish
USA (2,551 posts) Bio
Global Moderator |
| Date
| Reply #8 on Wed 05 Sep 2012 03:27 AM (UTC) |
| Message
| | Aha, thanks. |
https://github.com/fiendish/aardwolfclientpackage | | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
21,258 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top