Win32: More fulscreen improvements

This commit is contained in:
Elias Naur 2005-02-02 14:51:43 +00:00
parent 11d70f42a6
commit dfd7f8f804
1 changed files with 12 additions and 5 deletions

View File

@ -289,17 +289,24 @@ void closeWindow(HWND *hwnd, HDC *hdc)
static void appActivate(bool active) static void appActivate(bool active)
{ {
static bool inAppActivate = false; static bool inAppActivate = false;
isFocused = active;
if (inAppActivate) { if (inAppActivate) {
return; return;
} }
inAppActivate = true; inAppActivate = true;
isFocused = active;
if (active) { if (active) {
if (isFullScreen) { if (isFullScreen) {
restoreDisplayMode(); restoreDisplayMode();
} }
ShowWindow(display_hwnd, SW_RESTORE); ShowWindow(display_hwnd, SW_RESTORE);
SetForegroundWindow(display_hwnd); SetForegroundWindow(display_hwnd);
SetFocus(display_hwnd);
/*
* Calling wglMakeCurrent() (redundantly) seems to help some gfx cards
* restore from minimized to fullscreen.
*/
if (wglGetCurrentContext() == display_hglrc)
wglMakeCurrent(display_hdc, display_hglrc);
} else if (isFullScreen) { } else if (isFullScreen) {
ShowWindow(display_hwnd, SW_SHOWMINNOACTIVE); ShowWindow(display_hwnd, SW_SHOWMINNOACTIVE);
resetDisplayMode(NULL); resetDisplayMode(NULL);
@ -315,9 +322,9 @@ LRESULT CALLBACK lwjglWindowProc(HWND hWnd,
WPARAM wParam, WPARAM wParam,
LPARAM lParam) LPARAM lParam)
{ {
int xPos; int xPos;
int yPos; int yPos;
int dwheel; int dwheel;
switch (msg) { switch (msg) {
// disable screen saver and monitor power down messages which wreak havoc // disable screen saver and monitor power down messages which wreak havoc
case WM_SYSCOMMAND: case WM_SYSCOMMAND:
@ -356,7 +363,7 @@ LRESULT CALLBACK lwjglWindowProc(HWND hWnd,
isMinimized = true; isMinimized = true;
break; break;
} }
return 0L; break;
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
{ {
xPos = GET_X_LPARAM(lParam); xPos = GET_X_LPARAM(lParam);