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:
Fred Kiefer 2005-11-06 19:37:27 +00:00
parent ed11dd4840
commit a41f94ab08
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>
* Source/NSBrowser.m (-setPath:): Corrected memory management bug 14901.

View file

@ -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];

View file

@ -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])
{