(-mouseDown:): Rewrite to use -setHighlighted: and the normal drawing mechanism instead of trying to draw and flush manually.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@18060 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Alexander Malmberg 2003-11-07 15:32:33 +00:00
parent ca2773de30
commit 04ee2f9928
2 changed files with 12 additions and 10 deletions

View file

@ -1,3 +1,9 @@
2003-11-07 15:28 Alexander Malmberg <alexander@malmberg.org>
* Source/NSControl.m (-mouseDown:): Rewrite to use -setHighlighted:
and the normal drawing mechanisms instead of trying to draw and flush
manually. (Fixes a bunch of visual glitches.)
2003-11-07 14:42 Alexander Malmberg <alexander@malmberg.org> 2003-11-07 14:42 Alexander Malmberg <alexander@malmberg.org>
* Source/NSInputManager.m (-loadBindingsFromFile:): Handle errors * Source/NSInputManager.m (-loadBindingsFromFile:): Handle errors

View file

@ -562,7 +562,6 @@ static Class actionCellClass;
} }
[_window _captureMouse: self]; [_window _captureMouse: self];
[self lockFocus];
e = theEvent; e = theEvent;
while (!done) // loop until mouse goes up while (!done) // loop until mouse goes up
@ -574,8 +573,8 @@ static Class actionCellClass;
if ((location.x >= 0) && (location.x < _bounds.size.width) && if ((location.x >= 0) && (location.x < _bounds.size.width) &&
(location.y >= 0 && location.y < _bounds.size.height)) (location.y >= 0 && location.y < _bounds.size.height))
{ {
[_cell highlight: YES withFrame: _bounds inView: self]; [_cell setHighlighted: YES];
[_window flushWindow]; [self setNeedsDisplay: YES];
if ([_cell trackMouse: e if ([_cell trackMouse: e
inRect: _bounds inRect: _bounds
ofView: self ofView: self
@ -583,8 +582,8 @@ static Class actionCellClass;
done = mouseUp = YES; done = mouseUp = YES;
else else
{ {
[_cell highlight: NO withFrame: _bounds inView: self]; [_cell setHighlighted: NO];
[_window flushWindow]; [self setNeedsDisplay: YES];
} }
} }
@ -603,13 +602,10 @@ static Class actionCellClass;
if (mouseUp) if (mouseUp)
{ {
// [cell setState: ![cell state]]; [_cell setHighlighted: NO];
[_cell highlight: NO withFrame: _bounds inView: self]; [self setNeedsDisplay: YES];
[_window flushWindow];
} }
[self unlockFocus];
[_cell sendActionOn: oldActionMask]; [_cell sendActionOn: oldActionMask];
if (mouseUp) if (mouseUp)