diff --git a/ChangeLog b/ChangeLog index fc1b49809..09a315431 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-11-06 Fred Kiefer + + * Source/NSImage.m (-bestRepresentationForDevice:): Get the device + description from the current context, not via NSScreen, as we + cannot be sure about the screen order. + * Source/NSApplication.m (-_init): Make sure the default context + has properly set attributes. + 2005-11-03 Fred Kiefer * Source/NSBrowser.m (-setPath:): Corrected memory management bug 14901. diff --git a/Source/NSApplication.m b/Source/NSApplication.m index c1751c35e..04d9a3b22 100644 --- a/Source/NSApplication.m +++ b/Source/NSApplication.m @@ -782,9 +782,10 @@ static NSSize scaledIconSizeForSize(NSSize imageSize) - (void) _init { GSDisplayServer *srv; + NSDictionary *attributes; /* Initialization must be enclosed in an autorelease pool. */ CREATE_AUTORELEASE_POOL (_app_init_pool); - + /* * Set NSApp as soon as possible, since other gui classes (which * we refer or use in this method) might be calling [NSApplication @@ -804,8 +805,9 @@ static NSSize scaledIconSizeForSize(NSSize imageSize) RETAIN(srv); [GSDisplayServer setCurrentServer: srv]; - /* Create a default context. */ - _default_context = [NSGraphicsContext graphicsContextWithAttributes: nil]; + /* Create a default context with the attributes of the main screen. */ + attributes = [[NSScreen mainScreen] deviceDescription]; + _default_context = [NSGraphicsContext graphicsContextWithAttributes: attributes]; RETAIN(_default_context); [NSGraphicsContext setCurrentContext: _default_context]; diff --git a/Source/NSImage.m b/Source/NSImage.m index 253dbe503..35cb522ab 100644 --- a/Source/NSImage.m +++ b/Source/NSImage.m @@ -1363,10 +1363,8 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep) { if ([GSCurrentContext() isDrawingToScreen] == YES) { - int screen = [[[GSCurrentServer() attributes] - objectForKey: GSScreenNumber] intValue]; - deviceDescription = [[[NSScreen screens] objectAtIndex: screen] - deviceDescription]; + // Take the device description from the current context. + deviceDescription = [GSCurrentContext() attributes]; } else if ([NSPrintOperation currentOperation]) {