Bugfix: Client area was getting cropped when switching back to windowed under Windows.

This commit is contained in:
gogg 2010-01-11 08:03:58 +00:00
parent eff462f13f
commit 97c48d762f

View File

@ -779,20 +779,18 @@ do_windowed_switch() {
WINDOW_METRICS metrics;
bool has_origin;
_properties.set_origin(-1, -1);
if (!calculate_metrics(false, window_style, metrics, has_origin)){
return false;
}
// We make an initial SetWindowPos call so that the new styles are taken into account,
// then call do_reshape_request which does the actual sizing and positioning.
// We send SWP_FRAMECHANGED so that the new styles are taken into account.
// Also, we place the Windows at 0,0 to play safe until we decide how to
// get Panda to remember the windowed origin.
SetWindowPos(_hWnd, HWND_NOTOPMOST, metrics.x, metrics.y,
SetWindowPos(_hWnd, HWND_NOTOPMOST, 0, 0,
metrics.width, metrics.height,
SWP_FRAMECHANGED | SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE);
do_reshape_request(0, 0, false, metrics.width, metrics.height);
SWP_FRAMECHANGED | SWP_SHOWWINDOW);
return true;
}