Makes ESC always toggle full screen as requested in Issue 2225
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5025 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
0978551269
commit
7be712808a
|
@ -94,6 +94,9 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam )
|
||||||
switch (LOWORD(wParam))
|
switch (LOWORD(wParam))
|
||||||
{
|
{
|
||||||
case VK_ESCAPE:
|
case VK_ESCAPE:
|
||||||
|
ToggleFullscreen(hWnd);
|
||||||
|
return 0;
|
||||||
|
/*
|
||||||
if (g_Config.bFullscreen)
|
if (g_Config.bFullscreen)
|
||||||
{
|
{
|
||||||
// Pressing Esc switches to Windowed in Fullscreen mode
|
// Pressing Esc switches to Windowed in Fullscreen mode
|
||||||
|
@ -106,6 +109,7 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam )
|
||||||
PostMessage(m_hMain, WM_USER, WM_USER_STOP, 0);
|
PostMessage(m_hMain, WM_USER, WM_USER_STOP, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
break;
|
break;
|
||||||
case '3': // OSD keys
|
case '3': // OSD keys
|
||||||
case '4':
|
case '4':
|
||||||
|
@ -395,14 +399,14 @@ void ToggleFullscreen(HWND hParent, bool bForceFull)
|
||||||
RECT rcdesktop;
|
RECT rcdesktop;
|
||||||
GetWindowRect(GetDesktopWindow(), &rcdesktop);
|
GetWindowRect(GetDesktopWindow(), &rcdesktop);
|
||||||
|
|
||||||
// Set new window style FS -> Windowed
|
|
||||||
SetWindowLong(hParent, GWL_STYLE, style);
|
|
||||||
|
|
||||||
// SetWindowPos to the center of the screen
|
// SetWindowPos to the center of the screen
|
||||||
int X = (rcdesktop.right-rcdesktop.left)/2 - (rc.right-rc.left)/2;
|
int X = (rcdesktop.right-rcdesktop.left)/2 - (rc.right-rc.left)/2;
|
||||||
int Y = (rcdesktop.bottom-rcdesktop.top)/2 - (rc.bottom-rc.top)/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);
|
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
|
// Re-Enable the cursor
|
||||||
ShowCursor(TRUE);
|
ShowCursor(TRUE);
|
||||||
g_Config.bFullscreen = false;
|
g_Config.bFullscreen = false;
|
||||||
|
|
|
@ -243,6 +243,9 @@ void OnKeyDown(WPARAM wParam)
|
||||||
switch (LOWORD( wParam ))
|
switch (LOWORD( wParam ))
|
||||||
{
|
{
|
||||||
case VK_ESCAPE:
|
case VK_ESCAPE:
|
||||||
|
ToggleFullscreen(m_hWnd);
|
||||||
|
return;
|
||||||
|
/*
|
||||||
if (!g_Config.RenderToMainframe)
|
if (!g_Config.RenderToMainframe)
|
||||||
{
|
{
|
||||||
if (g_Config.bFullscreen)
|
if (g_Config.bFullscreen)
|
||||||
|
@ -258,6 +261,7 @@ void OnKeyDown(WPARAM wParam)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
break;
|
break;
|
||||||
case '3': // OSD keys
|
case '3': // OSD keys
|
||||||
case '4':
|
case '4':
|
||||||
|
@ -499,14 +503,14 @@ void ToggleFullscreen(HWND hParent, bool bForceFull)
|
||||||
RECT rcdesktop;
|
RECT rcdesktop;
|
||||||
GetWindowRect(GetDesktopWindow(), &rcdesktop);
|
GetWindowRect(GetDesktopWindow(), &rcdesktop);
|
||||||
|
|
||||||
// Set new window style FS -> Windowed
|
|
||||||
SetWindowLongPtr(hParent, GWL_STYLE, style);
|
|
||||||
|
|
||||||
// SetWindowPos to the center of the screen
|
// SetWindowPos to the center of the screen
|
||||||
int X = (rcdesktop.right-rcdesktop.left)/2 - (rc.right-rc.left)/2;
|
int X = (rcdesktop.right-rcdesktop.left)/2 - (rc.right-rc.left)/2;
|
||||||
int Y = (rcdesktop.bottom-rcdesktop.top)/2 - (rc.bottom-rc.top)/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);
|
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
|
// Re-Enable the cursor
|
||||||
ShowCursor(TRUE);
|
ShowCursor(TRUE);
|
||||||
g_Config.bFullscreen = false;
|
g_Config.bFullscreen = false;
|
||||||
|
|
Loading…
Reference in New Issue