src/video/cocoa/SDL_cocoamouse.m
changeset 7100 ffd910de700b
parent 7099 54f187c036e2
child 7106 31f8acac196b
equal deleted inserted replaced
7099:54f187c036e2 7100:ffd910de700b
   160     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
   160     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
   161 
   161 
   162     if (cursor) {
   162     if (cursor) {
   163         NSCursor *nscursor = (NSCursor *)cursor->driverdata;
   163         NSCursor *nscursor = (NSCursor *)cursor->driverdata;
   164 
   164 
   165         [nscursor set];
   165         /* We're possibly executing from an event handler where this operation
       
   166          * is unsupported. This will execute it in the main Cocoa event loop
       
   167          * after this returns.
       
   168          */
       
   169         [nscursor performSelectorOnMainThread:@selector(set)
       
   170                                    withObject:nil
       
   171                                 waitUntilDone:NO];
   166 
   172 
   167 		if (!isShown) {
   173 		if (!isShown) {
   168 			[NSCursor unhide];
   174 			[NSCursor unhide];
   169 			isShown = SDL_TRUE;
   175 			isShown = SDL_TRUE;
   170 		}
   176 		}