From b61d739f198da3d7d813c142359553194e86b2ec Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 2 Mar 2010 19:04:01 +0000 Subject: [PATCH] fix fullscreen failure case --- panda/src/windisplay/winGraphicsWindow.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/panda/src/windisplay/winGraphicsWindow.cxx b/panda/src/windisplay/winGraphicsWindow.cxx index ad52e5a3b0..1d0e334ac2 100644 --- a/panda/src/windisplay/winGraphicsWindow.cxx +++ b/panda/src/windisplay/winGraphicsWindow.cxx @@ -750,6 +750,11 @@ do_fullscreen_resize(int x_size, int y_size) { //////////////////////////////////////////////////////////////////// bool WinGraphicsWindow:: do_fullscreen_switch() { + if (!do_fullscreen_enable()) { + // Couldn't get fullscreen. + return false; + } + DWORD window_style = make_style(true); SetWindowLong(_hWnd, GWL_STYLE, window_style); @@ -758,10 +763,9 @@ do_fullscreen_switch() { if (!calculate_metrics(true, window_style, metrics, has_origin)){ return false; } + SetWindowPos(_hWnd, HWND_NOTOPMOST, 0, 0, metrics.width, metrics.height, SWP_FRAMECHANGED | SWP_SHOWWINDOW); - do_fullscreen_enable(); - return true; }