wf_toggle_fullscreen: change hwnd parent

Also: do not lose focus
This commit is contained in:
Benoit LeBlanc 2013-04-24 16:47:32 -04:00
parent 8b443989bb
commit 4bfa11bcca
2 changed files with 5 additions and 2 deletions

View File

@ -250,9 +250,11 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam
break;
case WM_KILLFOCUS:
DEBUG_KBD("loosing focus %X", hWnd);
if (g_focus_hWnd == hWnd)
if (g_focus_hWnd == hWnd && wfi && !wfi->fullscreen)
{
DEBUG_KBD("loosing focus %X", hWnd);
g_focus_hWnd = NULL;
}
break;
default:

View File

@ -282,6 +282,7 @@ void wf_toggle_fullscreen(wfInfo* wfi)
{
ShowWindow(wfi->hwnd, SW_HIDE);
wfi->fullscreen = !wfi->fullscreen;
SetParent(wfi->hwnd, wfi->fullscreen ? NULL : wfi->hWndParent);
wf_resize_window(wfi);
ShowWindow(wfi->hwnd, SW_SHOW);
SetForegroundWindow(wfi->hwnd);