diff src/video/wincommon/SDL_sysevents.c @ 3992:c75679dce60c SDL-1.2

Fixed bug #335 Use SetSystemPaletteUse() to get better access to the system palette. We can still do better palette matching in the case where we aren't using fullscreen mode or a hardware palette, but that can wait for another day. :)
author Sam Lantinga <slouken@libsdl.org>
date Tue, 03 Jul 2007 09:05:51 +0000
parents 203695f768e0
children 4e4866a72905
line wrap: on
line diff
--- a/src/video/wincommon/SDL_sysevents.c	Mon Jul 02 02:45:52 2007 +0000
+++ b/src/video/wincommon/SDL_sysevents.c	Tue Jul 03 09:05:51 2007 +0000
@@ -84,6 +84,7 @@
 
 /* Functions called by the message processing function */
 LONG (*HandleMessage)(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)=NULL;
+void (*WIN_Activate)(_THIS, BOOL active, BOOL iconic);
 void (*WIN_RealizePalette)(_THIS);
 void (*WIN_PaletteChanged)(_THIS, HWND window);
 void (*WIN_WinPAINT)(_THIS, HDC hdc);
@@ -348,11 +349,12 @@
 
 		case WM_ACTIVATE: {
 			SDL_VideoDevice *this = current_video;
-			BOOL minimized;
+			BOOL active, minimized;
 			Uint8 appstate;
 
 			minimized = HIWORD(wParam);
-			if ( !minimized && (LOWORD(wParam) != WA_INACTIVE) ) {
+			active = (LOWORD(wParam) != WA_INACTIVE) && !minimized;
+			if ( active ) {
 				/* Gain the following states */
 				appstate = SDL_APPACTIVE|SDL_APPINPUTFOCUS;
 				if ( this->input_grab != SDL_GRAB_OFF ) {
@@ -367,17 +369,14 @@
 					}
 				}
 #if defined(_WIN32_WCE)
-			if ( WINDIB_FULLSCREEN() )
-			{
-						LoadAygshell();
-						if( SHFullScreen )
-							SHFullScreen(SDL_Window, SHFS_HIDESTARTICON|SHFS_HIDETASKBAR|SHFS_HIDESIPBUTTON);
-						else
-							ShowWindow(FindWindow(TEXT("HHTaskBar"),NULL),SW_HIDE);
-
-			}
+				if ( WINDIB_FULLSCREEN() ) {
+					LoadAygshell();
+					if( SHFullScreen )
+						SHFullScreen(SDL_Window, SHFS_HIDESTARTICON|SHFS_HIDETASKBAR|SHFS_HIDESIPBUTTON);
+					else
+						ShowWindow(FindWindow(TEXT("HHTaskBar"),NULL),SW_HIDE);
+				}
 #endif
-
 				posted = SDL_PrivateAppActive(1, appstate);
 				WIN_GetKeyboardState();
 			} else {
@@ -401,12 +400,12 @@
 							SHFullScreen(SDL_Window, SHFS_SHOWSTARTICON|SHFS_SHOWTASKBAR|SHFS_SHOWSIPBUTTON);
 						else
 							ShowWindow(FindWindow(TEXT("HHTaskBar"),NULL),SW_SHOW);
-
 #endif
 					}
 				}
 				posted = SDL_PrivateAppActive(0, appstate);
 			}
+			WIN_Activate(this, active, minimized);
 			return(0);
 		}
 		break;