diff --git a/Source/NSButton.m b/Source/NSButton.m index abc01e9f8..9fcad24b8 100644 --- a/Source/NSButton.m +++ b/Source/NSButton.m @@ -363,6 +363,7 @@ id gnustep_gui_nsbutton_class = nil; [cell drawWithFrame:bounds inView:self]; } + [[self window] flushWindow]; [self unlockFocus]; } diff --git a/Source/NSCell.m b/Source/NSCell.m index 98179fb06..866df49b6 100644 --- a/Source/NSCell.m +++ b/Source/NSCell.m @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -633,7 +634,10 @@ // If point is in cellFrame then highlight the cell if ([controlView mouse: point inRect: cellFrame]) + { [self highlight:YES withFrame:cellFrame inView:controlView]; + [[controlView window] flushWindow]; + } else return NO; @@ -646,9 +650,6 @@ last_point = point; e = [theApp nextEventMatchingMask:event_mask untilDate:nil inMode:nil dequeue:YES]; - // What is going on here? After the following statement location - // should be in the window coordinates, but is in the receiving - // view's coordinate. location = [e locationInWindow]; point = [controlView convertPoint: location fromView: nil]; NSDebugLog(@"NSCell location %f %f\n", location.x, location.y); @@ -664,6 +665,7 @@ [self highlight: NO withFrame: cellFrame inView: controlView]; [self drawWithFrame: cellFrame inView: controlView]; + [[controlView window] flushWindow]; } // Do we now return or keep tracking @@ -684,6 +686,7 @@ [self highlight: YES withFrame: cellFrame inView: controlView]; //[self drawWithFrame: cellFrame inView: controlView]; + [[controlView window] flushWindow]; } } diff --git a/Source/NSControl.m b/Source/NSControl.m index 72edad92a..32d796c4a 100644 --- a/Source/NSControl.m +++ b/Source/NSControl.m @@ -311,12 +311,14 @@ right:(unsigned)rightDigits - (void)updateCell:(NSCell *)aCell { - [self drawCell:aCell]; + [self setNeedsDisplay:YES]; +// [self drawCell:aCell]; } - (void)updateCellInside:(NSCell *)aCell { - [self drawCellInside:aCell]; + [self setNeedsDisplay:YES]; +// [self drawCellInside:aCell]; } // diff --git a/Source/NSFont.m b/Source/NSFont.m index 66decf7b3..91b1dfa32 100644 --- a/Source/NSFont.m +++ b/Source/NSFont.m @@ -61,13 +61,13 @@ NSString*NSAFMXHeight = @"XHeight"; Convention (see the red book). */ static NSMutableSet* fontsUsed = nil; -static NSFont* getFont(NSString* key, NSString* defaultFont, float fontSize) +static NSFont* getFont(NSString* key, NSString* defaultFontName, float fontSize) { NSString* fontName; - + fontName = [[NSUserDefaults standardUserDefaults] objectForKey:key]; if (!fontName) - return [NSFont fontWithName: defaultFont size: fontSize]; + fontName = defaultFontName; return [NSFont fontWithName:fontName size:fontSize]; } diff --git a/Source/NSImage.m b/Source/NSImage.m index ed43dce97..689b66f98 100644 --- a/Source/NSImage.m +++ b/Source/NSImage.m @@ -232,7 +232,6 @@ set_repd_for_rep(NSMutableArray *_reps, NSImageRep *rep, rep_data_t *new_repd) NSImage* image = [[NSImage alloc] initByReferencingFile:path]; if (image) [image setName:_base_name(path)]; - [nameDict setObject: image forKey: [image name]]; return image; } } diff --git a/Source/NSResponder.m b/Source/NSResponder.m index d07f03f01..9c669ac75 100644 --- a/Source/NSResponder.m +++ b/Source/NSResponder.m @@ -195,7 +195,8 @@ if (eventSelector != @selector(keyDown:)) return; - NSBeep(); + /* Commented out to be able to create shared libraries on OS 4.1 */ +// NSBeep(); } - (void)rightMouseDown:(NSEvent *)theEvent diff --git a/Source/NSScroller.m b/Source/NSScroller.m index 40bde82c3..1267f3126 100644 --- a/Source/NSScroller.m +++ b/Source/NSScroller.m @@ -98,8 +98,7 @@ id gnustep_gui_nsscroller_class = nil; [super initWithFrame:frameRect]; // set our cell - [[self cell] release]; - [self setCell:[[gnustep_gui_nsscroller_class alloc] init]]; + [self setCell:[[gnustep_gui_nsscroller_class new] autorelease]]; [self selectCell: cell]; arrows_position = NSScrollerArrowsMaxEnd; diff --git a/Source/NSView.m b/Source/NSView.m index feffada29..57ca1facc 100644 --- a/Source/NSView.m +++ b/Source/NSView.m @@ -163,7 +163,7 @@ NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification"; is_flipped = NO; is_rotated_from_base = NO; is_rotated_or_scaled_from_base = NO; - opaque = NO; + opaque = YES; disable_autodisplay = NO; needs_display = YES; post_frame_changes = NO; @@ -756,24 +756,29 @@ NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification"; [self lockFocus]; [self drawRect:bounds]; - [self unlockFocus]; - + // Tell subviews to display j = [sub_views count]; for (i = 0;i < j; ++i) [(NSView *)[sub_views objectAtIndex:i] display]; + [[self window] flushWindow]; + [self unlockFocus]; } - (void)displayIfNeeded { - if ((needs_display) && (opaque)) + if ((needs_display) && (opaque)) { [self display]; + [self setNeedsDisplay:NO]; + } } - (void)displayIfNeededIgnoringOpacity { - if (needs_display) + if (needs_display) { [self display]; + [self setNeedsDisplay:NO]; + } } - (void)displayRect:(NSRect)aRect