Take care that images render to the correct screen.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@21963 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
FredKiefer 2005-11-06 19:37:27 +00:00
parent 88b2a97fdb
commit e692c0a7f0
3 changed files with 15 additions and 7 deletions

View file

@ -1,3 +1,11 @@
2005-11-06 Fred Kiefer <FredKiefer@gmx.de>
* 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 <FredKiefer@gmx.de> 2005-11-03 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSBrowser.m (-setPath:): Corrected memory management bug 14901. * Source/NSBrowser.m (-setPath:): Corrected memory management bug 14901.

View file

@ -782,9 +782,10 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
- (void) _init - (void) _init
{ {
GSDisplayServer *srv; GSDisplayServer *srv;
NSDictionary *attributes;
/* Initialization must be enclosed in an autorelease pool. */ /* Initialization must be enclosed in an autorelease pool. */
CREATE_AUTORELEASE_POOL (_app_init_pool); CREATE_AUTORELEASE_POOL (_app_init_pool);
/* /*
* Set NSApp as soon as possible, since other gui classes (which * Set NSApp as soon as possible, since other gui classes (which
* we refer or use in this method) might be calling [NSApplication * we refer or use in this method) might be calling [NSApplication
@ -804,8 +805,9 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
RETAIN(srv); RETAIN(srv);
[GSDisplayServer setCurrentServer: srv]; [GSDisplayServer setCurrentServer: srv];
/* Create a default context. */ /* Create a default context with the attributes of the main screen. */
_default_context = [NSGraphicsContext graphicsContextWithAttributes: nil]; attributes = [[NSScreen mainScreen] deviceDescription];
_default_context = [NSGraphicsContext graphicsContextWithAttributes: attributes];
RETAIN(_default_context); RETAIN(_default_context);
[NSGraphicsContext setCurrentContext: _default_context]; [NSGraphicsContext setCurrentContext: _default_context];

View file

@ -1363,10 +1363,8 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
{ {
if ([GSCurrentContext() isDrawingToScreen] == YES) if ([GSCurrentContext() isDrawingToScreen] == YES)
{ {
int screen = [[[GSCurrentServer() attributes] // Take the device description from the current context.
objectForKey: GSScreenNumber] intValue]; deviceDescription = [GSCurrentContext() attributes];
deviceDescription = [[[NSScreen screens] objectAtIndex: screen]
deviceDescription];
} }
else if ([NSPrintOperation currentOperation]) else if ([NSPrintOperation currentOperation])
{ {