diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index 0489df1ba0..65ba59f3c0 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -161,7 +161,8 @@ CPanel::CPanel( return 0; case WIIMOTE_DISCONNECT: - if( SConfig::GetInstance().m_LocalCoreStartupParameter.bWii ){ //Only Alerts if the game is a wii game. + if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii) + { if (main_frame->bNoWiimoteMsg) main_frame->bNoWiimoteMsg = false; else diff --git a/Source/Plugins/Plugin_VideoDX9/Src/EmuWindow.cpp b/Source/Plugins/Plugin_VideoDX9/Src/EmuWindow.cpp index a825f0b694..64b5cc775e 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/EmuWindow.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/EmuWindow.cpp @@ -154,8 +154,6 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam ) } else if (wParam == WIIMOTE_DISCONNECT) { - if (g_Config.bFullscreen) - ToggleFullscreen(hWnd); PostMessage(m_hMain, WM_USER, wParam, lParam); } break; @@ -305,7 +303,7 @@ void ToggleFullscreen(HWND hParent, bool bForceFull) dmScreenSettings.dmPelsWidth = w_fs; dmScreenSettings.dmPelsHeight = h_fs; dmScreenSettings.dmFields = DM_PELSWIDTH|DM_PELSHEIGHT; - if (ChangeDisplaySettings(&dmScreenSettings, 0) != DISP_CHANGE_SUCCESSFUL) + if (ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL) return; // Set new window style -> PopUp @@ -335,14 +333,14 @@ void ToggleFullscreen(HWND hParent, bool bForceFull) RECT rcdesktop; GetWindowRect(GetDesktopWindow(), &rcdesktop); + // Set new window style FS -> Windowed + SetWindowLong(hParent, GWL_STYLE, style); + // SetWindowPos to the center of the screen int X = (rcdesktop.right-rcdesktop.left)/2 - (rc.right-rc.left)/2; int Y = (rcdesktop.bottom-rcdesktop.top)/2 - (rc.bottom-rc.top)/2; SetWindowPos(hParent, NULL, X, Y, rc.right-rc.left, rc.bottom-rc.top, SWP_NOREPOSITION | SWP_NOZORDER); - // Set new window style FS -> Windowed - SetWindowLong(hParent, GWL_STYLE, style); - // Re-Enable the cursor ShowCursor(TRUE); g_Config.bFullscreen = false; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp b/Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp index 686984f610..2913f6654d 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp @@ -349,7 +349,9 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam) ToggleFullscreen(m_hWnd); } else if (wParam == WIIMOTE_DISCONNECT) + { PostMessage(m_hMain, WM_USER, wParam, lParam); + } break; // This is called when we close the window when we render to a separate window @@ -461,7 +463,7 @@ void ToggleFullscreen(HWND hParent, bool bForceFull) dmScreenSettings.dmPelsWidth = w_fs; dmScreenSettings.dmPelsHeight = h_fs; dmScreenSettings.dmFields = DM_PELSWIDTH|DM_PELSHEIGHT; - if (ChangeDisplaySettings(&dmScreenSettings, 0) != DISP_CHANGE_SUCCESSFUL) + if (ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL) return; // Set new window style -> PopUp @@ -490,14 +492,14 @@ void ToggleFullscreen(HWND hParent, bool bForceFull) RECT rcdesktop; GetWindowRect(GetDesktopWindow(), &rcdesktop); + // Set new window style FS -> Windowed + SetWindowLongPtr(hParent, GWL_STYLE, style); + // SetWindowPos to the center of the screen int X = (rcdesktop.right-rcdesktop.left)/2 - (rc.right-rc.left)/2; int Y = (rcdesktop.bottom-rcdesktop.top)/2 - (rc.bottom-rc.top)/2; SetWindowPos(hParent, NULL, X, Y, rc.right-rc.left, rc.bottom-rc.top, SWP_NOREPOSITION | SWP_NOZORDER); - // Set new window style FS -> Windowed - SetWindowLongPtr(hParent, GWL_STYLE, style); - // Re-Enable the cursor ShowCursor(TRUE); g_Config.bFullscreen = false;