src/video/windx5/SDL_dx5events.c
branchSDL-1.2
changeset 4383 daf9e6037596
parent 4291 6cc2b35ac610
child 4384 6800e2560310
equal deleted inserted replaced
4382:6599c89de50c 4383:daf9e6037596
   557 		case WM_ACTIVATEAPP: {
   557 		case WM_ACTIVATEAPP: {
   558 			int i, active;
   558 			int i, active;
   559 
   559 
   560 			active = (wParam && (GetForegroundWindow() == hwnd));
   560 			active = (wParam && (GetForegroundWindow() == hwnd));
   561 			if ( active ) {
   561 			if ( active ) {
   562 				for ( i=0; SDL_DIdev[i]; ++i ) {
   562 				for ( i=0; i<MAX_INPUTS; ++i ) {
   563 					IDirectInputDevice2_Acquire(
   563 					if (SDL_DIdev[i] != NULL)
       
   564 						IDirectInputDevice2_Acquire(
   564 								SDL_DIdev[i]);
   565 								SDL_DIdev[i]);
   565 				}
   566 				}
   566 			} else {
   567 			} else {
   567 				for ( i=0; SDL_DIdev[i]; ++i ) {
   568 				for ( i=0; i<MAX_INPUTS; ++i ) {
   568 					IDirectInputDevice2_Unacquire(
   569 					if (SDL_DIdev[i] != NULL) 
       
   570 						IDirectInputDevice2_Unacquire(
   569 								SDL_DIdev[i]);
   571 								SDL_DIdev[i]);
   570 				}
   572 				}
   571 				mouse_lost = 1;
   573 				mouse_lost = 1;
   572 			}
   574 			}
   573 		}
   575 		}