src/video/quartz/SDL_QuartzEvents.m
changeset 615 7ec821f3cbd0
parent 563 04dcaf3da918
child 619 bf816ce70144
equal deleted inserted replaced
614:0b4c3f5ff63d 615:7ec821f3cbd0
   299 
   299 
   300 static void QZ_DoActivate (_THIS)
   300 static void QZ_DoActivate (_THIS)
   301 {
   301 {
   302     in_foreground = YES;
   302     in_foreground = YES;
   303     
   303     
   304     /* Hide the mouse cursor if was hidden */
   304     /* Hide the cursor if it was hidden by SDL_ShowCursor() */
   305     if (!cursor_visible) {
   305     if (!cursor_visible && !cursor_hidden) {
   306         HideCursor ();
   306         HideCursor ();
       
   307         cursor_hidden = YES;
   307     }
   308     }
   308 
   309 
   309     /* Regrab input, only if it was previously grabbed */
   310     /* Regrab input, only if it was previously grabbed */
   310     if ( current_grab_mode == SDL_GRAB_ON ) {
   311     if ( current_grab_mode == SDL_GRAB_ON ) {
   311         
   312         
   328     QZ_PrivateCocoaToSDL (this, &cursor_loc);
   329     QZ_PrivateCocoaToSDL (this, &cursor_loc);
   329     
   330     
   330     /* Reassociate mouse and cursor */
   331     /* Reassociate mouse and cursor */
   331     CGAssociateMouseAndMouseCursorPosition (1);
   332     CGAssociateMouseAndMouseCursorPosition (1);
   332 
   333 
   333     /* Show the cursor */
   334     /* Show the cursor if it was hidden by SDL_ShowCursor() */
   334     ShowCursor ();
   335     if (!cursor_visible && cursor_hidden) {
       
   336         ShowCursor ();
       
   337         cursor_hidden = NO;
       
   338     }
   335 
   339 
   336     SDL_PrivateAppActive (0, SDL_APPINPUTFOCUS);
   340     SDL_PrivateAppActive (0, SDL_APPINPUTFOCUS);
   337 }
   341 }
   338 
   342 
   339 void QZ_SleepNotificationHandler (void * refcon,
   343 void QZ_SleepNotificationHandler (void * refcon,