src/video/quartz/SDL_QuartzEvents.m
changeset 158 4382c38dfbee
parent 155 2d162219f433
child 168 e92aa316c517
     1.1 --- a/src/video/quartz/SDL_QuartzEvents.m	Mon Aug 20 04:41:49 2001 +0000
     1.2 +++ b/src/video/quartz/SDL_QuartzEvents.m	Tue Aug 21 07:19:59 2001 +0000
     1.3 @@ -223,7 +223,7 @@
     1.4  }
     1.5  
     1.6  static void QZ_PumpEvents (_THIS)
     1.7 -{ 
     1.8 +{
     1.9      NSDate *distantPast;
    1.10      NSEvent *event;
    1.11      NSRect winRect;
    1.12 @@ -247,27 +247,29 @@
    1.13      
    1.14          if (event != nil) {
    1.15              unsigned int type;
    1.16 +            BOOL isForGameWin;
    1.17  
    1.18 -            #define DO_MOUSE_DOWN(button, sendToWindow)                      \
    1.19 +            #define DO_MOUSE_DOWN(button, sendToWindow) do {                 \
    1.20                  if ( inForeground ) {                                        \
    1.21                      if ( (SDL_VideoSurface->flags & SDL_FULLSCREEN) ||       \
    1.22                           NSPointInRect([event locationInWindow], winRect) )  \
    1.23                          SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);  \
    1.24 -                    else if (sendToWindow)                                   \
    1.25 -                            [ window sendEvent:event ];                      \
    1.26                  }                                                            \
    1.27                  else {                                                       \
    1.28                      QZ_DoActivate (this);                                    \
    1.29 -                }       
    1.30 -            
    1.31 -            #define DO_MOUSE_UP(button, sendToWindow)                        \
    1.32 +                }                                                            \
    1.33 +                [ NSApp sendEvent:event ];                                   \
    1.34 +                } while(0)
    1.35 +                
    1.36 +            #define DO_MOUSE_UP(button, sendToWindow) do {                   \
    1.37                  if ( (SDL_VideoSurface->flags & SDL_FULLSCREEN) ||           \
    1.38                       !NSPointInRect([event locationInWindow], titleBarRect) )\
    1.39                      SDL_PrivateMouseButton (SDL_RELEASED, button, 0, 0);     \
    1.40 -                if (sendToWindow)                                            \
    1.41 -                    [ window sendEvent:event ]
    1.42 -                    
    1.43 +                [ NSApp sendEvent:event ];                                   \
    1.44 +                } while(0)
    1.45 +
    1.46              type = [ event type ];
    1.47 +            isForGameWin = (qz_window == [ event window ]);
    1.48              switch (type) {
    1.49              
    1.50              case NSLeftMouseDown:  
    1.51 @@ -351,8 +353,8 @@
    1.52              case NSFlagsChanged:
    1.53                  QZ_DoModifiers( [ event modifierFlags ] );
    1.54                  break;
    1.55 -            case NSMouseEntered: break;
    1.56 -            case NSMouseExited: break;
    1.57 +//            case NSMouseEntered: break;
    1.58 +//            case NSMouseExited: break;
    1.59              case NSAppKitDefined:
    1.60                  switch ( [ event subtype ] ) {
    1.61                  case NSApplicationActivatedEventType:
    1.62 @@ -361,14 +363,14 @@
    1.63                  case NSApplicationDeactivatedEventType:
    1.64                      QZ_DoDeactivate (this);
    1.65                      break;
    1.66 -                case NSWindowMovedEventType:
    1.67 -                    [ window sendEvent:event ];
    1.68 -                    break;
    1.69                  }
    1.70 +                [ NSApp sendEvent:event ];
    1.71                  break;
    1.72 -            case NSApplicationDefined: break;
    1.73 -            case NSPeriodic: break;
    1.74 -            case NSCursorUpdate: break;
    1.75 +//            case NSApplicationDefined: break;
    1.76 +//            case NSPeriodic: break;
    1.77 +//            case NSCursorUpdate: break;
    1.78 +            default:
    1.79 +                [ NSApp sendEvent:event ];
    1.80              }
    1.81          }
    1.82        } while (event != nil);