src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m

Print this page

        

*** 43,52 **** --- 43,53 ---- #include <signal.h> #include <unistd.h> #include <dlfcn.h> #include <sizecalc.h> + #import "ThreadUtilities.h" static NSScreen* SplashNSScreen() { return [[NSScreen screens] objectAtIndex: 0]; }
*** 128,138 **** char* SplashGetScaledImageName(const char* jar, const char* file, float *scaleFactor) { NSAutoreleasePool *pool = [NSAutoreleasePool new]; *scaleFactor = 1; char* scaledFile = nil; ! float screenScaleFactor = [SplashNSScreen() backingScaleFactor]; if (screenScaleFactor > 1) { NSString *fileName = [NSString stringWithUTF8String: file]; NSUInteger length = [fileName length]; NSRange range = [fileName rangeOfString: @"." --- 129,143 ---- char* SplashGetScaledImageName(const char* jar, const char* file, float *scaleFactor) { NSAutoreleasePool *pool = [NSAutoreleasePool new]; *scaleFactor = 1; char* scaledFile = nil; ! __block float screenScaleFactor = 1; ! ! [ThreadUtilities performOnMainThreadWaiting:YES block:^(){ ! screenScaleFactor = [SplashNSScreen() backingScaleFactor]; ! }]; if (screenScaleFactor > 1) { NSString *fileName = [NSString stringWithUTF8String: file]; NSUInteger length = [fileName length]; NSRange range = [fileName rangeOfString: @"."