PuTTY semi-bug window-placement

This is a mirror. Follow this link to find the primary PuTTY web site.

Home | FAQ | Feedback | Licence | Updates | Mirrors | Keys | Links | Team
Download: Stable · Snapshot | Docs | Changes | Wishlist

summary: Window placement circumvents Windows default rules
class: semi-bug: This might or might not be a bug, depending on your precise definition of what a bug is.
difficulty: tricky: Needs many tuits.
priority: low: We aren't sure whether to fix this or not.

When creating its window, PuTTY first creates a `guess' window of
arbitrary size, and then measures the difference between its full
area and client area. This allows it to know how much space the
window borders take up, so it can calculate what size the window
should really be and resize the guess window to that size.
Unfortunately this breaks the Windows default window placement.

It's possible that fixing this would be as easy as closing the guess
window and opening a new one. Then again, perhaps that would cause
its own problems. I'm not entirely sure what a Windows app should do
if it wants to open a window in one go with a client area of a
specific size.

Update: it's been suggested that AdjustWindowRect(Ex) is useful. We
still need a device context for font metrics; we could get one from
the desktop but that might break in the presence of multiple monitors.

Further update: it's been suggested that GetWindowDC(NULL) should be
fine in 99% of cases.

2006-Feb-26: I've done some experimenting with this change, but it
seems to have a few unexpected interactions with the rest of our
resize code (which needs an overhaul in any case).
Audit trail for this semi-bug.

If you want to comment on this web site, see the Feedback page.
(last revision of this bug record was at 2006-02-26 21:25:28 +0000)