src/video/cocoa/SDL_cocoamouse.m
changeset 7100 ffd910de700b
parent 7099 54f187c036e2
child 7106 31f8acac196b
     1.1 --- a/src/video/cocoa/SDL_cocoamouse.m	Tue Apr 23 18:47:41 2013 -0700
     1.2 +++ b/src/video/cocoa/SDL_cocoamouse.m	Tue Apr 23 18:47:44 2013 -0700
     1.3 @@ -162,7 +162,13 @@
     1.4      if (cursor) {
     1.5          NSCursor *nscursor = (NSCursor *)cursor->driverdata;
     1.6  
     1.7 -        [nscursor set];
     1.8 +        /* We're possibly executing from an event handler where this operation
     1.9 +         * is unsupported. This will execute it in the main Cocoa event loop
    1.10 +         * after this returns.
    1.11 +         */
    1.12 +        [nscursor performSelectorOnMainThread:@selector(set)
    1.13 +                                   withObject:nil
    1.14 +                                waitUntilDone:NO];
    1.15  
    1.16  		if (!isShown) {
    1.17  			[NSCursor unhide];