Final fix for bug #373 SDL-1.2
authorSam Lantinga
Sun, 15 Jul 2007 17:22:39 +0000
branchSDL-1.2
changeset 40726930cd5ab933
parent 4071 3d9040dcc47e
child 4073 0dd0ca51d941
Final fix for bug #373

------- Comment #13 From Christian Walther 2007-07-15 10:04:56 [reply] -------
Created an attachment (id=229) [details]
patch to reinstate the SDL cursor after an NSApplicationActivatedEvent

Oops, you're right. My testcursor.c has diverged so far from the original that
I missed that. In fact, now that I think about it, that issue isn't even
addressed by the cursor rectangle patch - it is only concerned with windowed
mode (and fixes the problem there as a side effect). The problem in fullscreen
is still the same as before. How about the attachment for a fix? (I can confirm
that [NSCursor set] doesn't seem to have any effect when called from
QZ_DoActivate().)
src/video/quartz/SDL_QuartzEvents.m
     1.1 --- a/src/video/quartz/SDL_QuartzEvents.m	Sun Jul 15 16:33:45 2007 +0000
     1.2 +++ b/src/video/quartz/SDL_QuartzEvents.m	Sun Jul 15 17:22:39 2007 +0000
     1.3 @@ -945,7 +945,16 @@
     1.4                      break;
     1.5                  case NSFlagsChanged:
     1.6                      break;
     1.7 -                    /* case NSAppKitDefined: break; */
     1.8 +                case NSAppKitDefined:
     1.9 +                    [ NSApp sendEvent:event ];
    1.10 +                    if ([ event subtype ] == NSApplicationActivatedEventType && (mode_flags & SDL_FULLSCREEN)) {
    1.11 +                        /* the default handling of this event seems to reset any cursor set by [NSCursor set] (used by SDL_SetCursor() in fullscreen mode) to the default system arrow cursor */
    1.12 +                        SDL_Cursor *sdlc = SDL_GetCursor();
    1.13 +                        if (sdlc != NULL && sdlc->wm_cursor != NULL) {
    1.14 +                            [ sdlc->wm_cursor->nscursor set ];
    1.15 +                        }
    1.16 +                    }
    1.17 +                    break;
    1.18                      /* case NSApplicationDefined: break; */
    1.19                      /* case NSPeriodic: break; */
    1.20                      /* case NSCursorUpdate: break; */