mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-29 21:17:39 +00:00
Lock focus fixes - get cells to lock focus before drawing themselves.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4924 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8171e4cc22
commit
dd34792910
13 changed files with 85 additions and 25 deletions
|
@ -1289,8 +1289,10 @@ fprintf(stderr, " NSMatrix: selectTextAtRow --- ");
|
|||
|
||||
if (drawsCellBackground)
|
||||
{
|
||||
[self lockFocus];
|
||||
[cellBackgroundColor set];
|
||||
NSRectFill(cellFrame);
|
||||
[self unlockFocus];
|
||||
}
|
||||
[aCell highlight: flag
|
||||
withFrame: cellFrame
|
||||
|
@ -1386,8 +1388,6 @@ fprintf(stderr, " NSMatrix: selectTextAtRow --- ");
|
|||
unsigned eventMask = NSLeftMouseUpMask | NSLeftMouseDownMask
|
||||
| NSMouseMovedMask | NSLeftMouseDraggedMask;
|
||||
|
||||
[self lockFocus];
|
||||
|
||||
if ((mode == NSRadioModeMatrix) && selectedCell)
|
||||
{
|
||||
[selectedCell setState: NSOffState];
|
||||
|
@ -1499,8 +1499,6 @@ fprintf(stderr, " NSMatrix: selectTextAtRow --- ");
|
|||
column: highlightedColumn];
|
||||
[window flushWindow];
|
||||
}
|
||||
|
||||
[self unlockFocus];
|
||||
}
|
||||
|
||||
|
||||
|
@ -1533,7 +1531,6 @@ fprintf(stderr, " NSMatrix: selectTextAtRow --- ");
|
|||
[NSEvent startPeriodicEventsAfterDelay: 0.05 withPeriod: 0.05];
|
||||
ASSIGN(lastEvent, theEvent);
|
||||
|
||||
[self lockFocus];
|
||||
// selection involves two steps, first
|
||||
// a loop that continues until the left mouse goes up; then a series of
|
||||
// steps which send actions and display the cell as it should appear after
|
||||
|
@ -1743,8 +1740,6 @@ fprintf(stderr, " NSMatrix: selectTextAtRow --- ");
|
|||
if (target && doubleAction && ([lastEvent clickCount] > 1))
|
||||
[target performSelector: doubleAction withObject: self];
|
||||
|
||||
[self unlockFocus];
|
||||
|
||||
if ((mode != NSTrackModeMatrix) && (mode != NSHighlightModeMatrix))
|
||||
[NSEvent stopPeriodicEvents];
|
||||
|
||||
|
@ -2051,14 +2046,11 @@ fprintf(stderr, " NSMatrix: selectTextAtRow --- ");
|
|||
if (![selectedCell isEditable])
|
||||
return;
|
||||
|
||||
[self lockFocus];
|
||||
|
||||
// If RETURN key then make the next text the first responder
|
||||
if (key_code == 0x0d)
|
||||
{
|
||||
[selectedCell endEditing: nil];
|
||||
[selectedCell drawInteriorWithFrame: rect inView: self];
|
||||
[self unlockFocus];
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2067,7 +2059,6 @@ fprintf(stderr, " NSMatrix: selectTextAtRow --- ");
|
|||
|
||||
[selectedCell _handleKeyEvent: theEvent];
|
||||
[selectedCell drawInteriorWithFrame: rect inView: self];
|
||||
[self unlockFocus];
|
||||
}
|
||||
|
||||
- (BOOL) acceptsFirstResponder
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue