From 97c48d762f1470631e712eeffcd74e1aa60f83f3 Mon Sep 17 00:00:00 2001 From: gogg Date: Mon, 11 Jan 2010 08:03:58 +0000 Subject: [PATCH] Bugfix: Client area was getting cropped when switching back to windowed under Windows. --- panda/src/windisplay/winGraphicsWindow.cxx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/panda/src/windisplay/winGraphicsWindow.cxx b/panda/src/windisplay/winGraphicsWindow.cxx index fc4ecaf5ef..ad52e5a3b0 100644 --- a/panda/src/windisplay/winGraphicsWindow.cxx +++ b/panda/src/windisplay/winGraphicsWindow.cxx @@ -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; }