From 195cfdb0b8676f180da3a577df1e4021515bc074 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 15 Jul 2007 17:22:39 +0000 Subject: [PATCH] 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 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/video/quartz/SDL_QuartzEvents.m b/src/video/quartz/SDL_QuartzEvents.m index 2e1296636..0e9097607 100644 --- a/src/video/quartz/SDL_QuartzEvents.m +++ b/src/video/quartz/SDL_QuartzEvents.m @@ -945,7 +945,16 @@ disassociated from the mouse (and therefore break; case NSFlagsChanged: break; - /* case NSAppKitDefined: break; */ + case NSAppKitDefined: + [ NSApp sendEvent:event ]; + if ([ event subtype ] == NSApplicationActivatedEventType && (mode_flags & SDL_FULLSCREEN)) { + /* 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 */ + SDL_Cursor *sdlc = SDL_GetCursor(); + if (sdlc != NULL && sdlc->wm_cursor != NULL) { + [ sdlc->wm_cursor->nscursor set ]; + } + } + break; /* case NSApplicationDefined: break; */ /* case NSPeriodic: break; */ /* case NSCursorUpdate: break; */