comparison 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
comparison
equal deleted inserted replaced
3991:7a649501c089 3992:c75679dce60c
82 WORD *gamma_saved = NULL; 82 WORD *gamma_saved = NULL;
83 83
84 84
85 /* Functions called by the message processing function */ 85 /* Functions called by the message processing function */
86 LONG (*HandleMessage)(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)=NULL; 86 LONG (*HandleMessage)(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)=NULL;
87 void (*WIN_Activate)(_THIS, BOOL active, BOOL iconic);
87 void (*WIN_RealizePalette)(_THIS); 88 void (*WIN_RealizePalette)(_THIS);
88 void (*WIN_PaletteChanged)(_THIS, HWND window); 89 void (*WIN_PaletteChanged)(_THIS, HWND window);
89 void (*WIN_WinPAINT)(_THIS, HDC hdc); 90 void (*WIN_WinPAINT)(_THIS, HDC hdc);
90 extern void DIB_SwapGamma(_THIS); 91 extern void DIB_SwapGamma(_THIS);
91 92
346 #endif 347 #endif
347 switch (msg) { 348 switch (msg) {
348 349
349 case WM_ACTIVATE: { 350 case WM_ACTIVATE: {
350 SDL_VideoDevice *this = current_video; 351 SDL_VideoDevice *this = current_video;
351 BOOL minimized; 352 BOOL active, minimized;
352 Uint8 appstate; 353 Uint8 appstate;
353 354
354 minimized = HIWORD(wParam); 355 minimized = HIWORD(wParam);
355 if ( !minimized && (LOWORD(wParam) != WA_INACTIVE) ) { 356 active = (LOWORD(wParam) != WA_INACTIVE) && !minimized;
357 if ( active ) {
356 /* Gain the following states */ 358 /* Gain the following states */
357 appstate = SDL_APPACTIVE|SDL_APPINPUTFOCUS; 359 appstate = SDL_APPACTIVE|SDL_APPINPUTFOCUS;
358 if ( this->input_grab != SDL_GRAB_OFF ) { 360 if ( this->input_grab != SDL_GRAB_OFF ) {
359 WIN_GrabInput(this, SDL_GRAB_ON); 361 WIN_GrabInput(this, SDL_GRAB_ON);
360 } 362 }
365 if ( WINDIB_FULLSCREEN() ) { 367 if ( WINDIB_FULLSCREEN() ) {
366 SDL_RestoreGameMode(); 368 SDL_RestoreGameMode();
367 } 369 }
368 } 370 }
369 #if defined(_WIN32_WCE) 371 #if defined(_WIN32_WCE)
370 if ( WINDIB_FULLSCREEN() ) 372 if ( WINDIB_FULLSCREEN() ) {
371 { 373 LoadAygshell();
372 LoadAygshell(); 374 if( SHFullScreen )
373 if( SHFullScreen ) 375 SHFullScreen(SDL_Window, SHFS_HIDESTARTICON|SHFS_HIDETASKBAR|SHFS_HIDESIPBUTTON);
374 SHFullScreen(SDL_Window, SHFS_HIDESTARTICON|SHFS_HIDETASKBAR|SHFS_HIDESIPBUTTON); 376 else
375 else 377 ShowWindow(FindWindow(TEXT("HHTaskBar"),NULL),SW_HIDE);
376 ShowWindow(FindWindow(TEXT("HHTaskBar"),NULL),SW_HIDE); 378 }
377 379 #endif
378 }
379 #endif
380
381 posted = SDL_PrivateAppActive(1, appstate); 380 posted = SDL_PrivateAppActive(1, appstate);
382 WIN_GetKeyboardState(); 381 WIN_GetKeyboardState();
383 } else { 382 } else {
384 /* Lose the following states */ 383 /* Lose the following states */
385 appstate = SDL_APPINPUTFOCUS; 384 appstate = SDL_APPINPUTFOCUS;
399 LoadAygshell(); 398 LoadAygshell();
400 if( SHFullScreen ) 399 if( SHFullScreen )
401 SHFullScreen(SDL_Window, SHFS_SHOWSTARTICON|SHFS_SHOWTASKBAR|SHFS_SHOWSIPBUTTON); 400 SHFullScreen(SDL_Window, SHFS_SHOWSTARTICON|SHFS_SHOWTASKBAR|SHFS_SHOWSIPBUTTON);
402 else 401 else
403 ShowWindow(FindWindow(TEXT("HHTaskBar"),NULL),SW_SHOW); 402 ShowWindow(FindWindow(TEXT("HHTaskBar"),NULL),SW_SHOW);
404
405 #endif 403 #endif
406 } 404 }
407 } 405 }
408 posted = SDL_PrivateAppActive(0, appstate); 406 posted = SDL_PrivateAppActive(0, appstate);
409 } 407 }
408 WIN_Activate(this, active, minimized);
410 return(0); 409 return(0);
411 } 410 }
412 break; 411 break;
413 412
414 case WM_MOUSEMOVE: { 413 case WM_MOUSEMOVE: {