Make sure there is a main window when starting up.

Correct view image caching.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25670 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2007-12-03 19:00:12 +00:00
parent 3cbe23c511
commit 36c066e994
3 changed files with 25 additions and 1 deletions

View file

@ -1,3 +1,12 @@
2007-12-03 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSView.m (-bitmapImageRepForCachingDisplayInRect:): Don't
cache the image here.
* Source/NSView.m (-cacheDisplayInRect:toBitmapImageRep:): Lock
focus on the current view.
* Source/NSApplication.m (-finishLaunching): Make sure we have a
designated main window.
2007-12-02 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSBezierPath.m (-encodeWithCoder:, -initWithCoder:):

View file

@ -1009,6 +1009,20 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
[_key_window orderFrontRegardless];
}
// Make sure there is one designated main window
if (_main_window == nil)
{
for (i = 0; i < count; i++)
{
NSWindow *win = [windows_list objectAtIndex: i];
if ([win canBecomeKeyWindow])
{
_key_window = win;
}
}
}
/* Register self as observer to window events. */
[nc addObserver: self selector: @selector(_windowWillClose:)
name: NSWindowWillCloseNotification object: nil];

View file

@ -2531,7 +2531,6 @@ convert_rect_using_matrices(NSRect aRect, NSAffineTransform *matrix1,
colorSpaceName: space
bytesPerRow: 0
bitsPerPixel: 0];
[self cacheDisplayInRect: rect toBitmapImageRep: bitmap];
return bitmap;
}
@ -2541,7 +2540,9 @@ convert_rect_using_matrices(NSRect aRect, NSAffineTransform *matrix1,
NSDictionary *dict;
NSData *imageData;
[self lockFocus];
dict = [GSCurrentContext() GSReadRect: rect];
[self unlockFocus];
imageData = RETAIN([dict objectForKey: @"Data"]);
// FIXME: Copy the image data to the bitmap
memcpy([bitmap bitmapData], [imageData bytes], [imageData length]);