Fix candidate window visual artifacts
* Use a built-in window level instead of the non-standard one * Don't force the window to re-draw * Defer orderFront: and orderBack:
This commit is contained in:
parent
28ca23b453
commit
e406645893
|
@ -138,10 +138,10 @@
|
|||
- (void)setVisible:(BOOL)visible
|
||||
{
|
||||
if (visible) {
|
||||
[[self window] orderFront:self];
|
||||
[[self window] performSelector:@selector(orderFront:) withObject:self afterDelay:0.0];
|
||||
}
|
||||
else {
|
||||
[[self window] orderOut:self];
|
||||
[[self window] performSelector:@selector(orderOut:) withObject:self afterDelay:0.0];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
NSUInteger styleMask = NSBorderlessWindowMask | NSNonactivatingPanelMask;
|
||||
|
||||
NSPanel *panel = [[[NSPanel alloc] initWithContentRect:contentRect styleMask:styleMask backing:NSBackingStoreBuffered defer:NO] autorelease];
|
||||
[panel setLevel:CGShieldingWindowLevel() + 1];
|
||||
[panel setLevel:kCGPopUpMenuWindowLevel];
|
||||
[panel setHasShadow:YES];
|
||||
|
||||
self = [self initWithWindow:panel];
|
||||
|
@ -229,7 +229,7 @@
|
|||
frameRect.size = newSize;
|
||||
frameRect.origin = NSMakePoint(topLeftPoint.x, topLeftPoint.y - frameRect.size.height);
|
||||
|
||||
[[self window] setFrame:frameRect display:YES];
|
||||
[[self window] setFrame:frameRect display:NO];
|
||||
[_candidateView setNeedsDisplay:YES];
|
||||
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ static const CGFloat kCandidateTextLeftMargin = 8.0;
|
|||
NSUInteger styleMask = NSBorderlessWindowMask | NSNonactivatingPanelMask;
|
||||
|
||||
NSPanel *panel = [[[NSPanel alloc] initWithContentRect:contentRect styleMask:styleMask backing:NSBackingStoreBuffered defer:NO] autorelease];
|
||||
[panel setLevel:CGShieldingWindowLevel() + 1];
|
||||
[panel setLevel:kCGPopUpMenuWindowLevel];
|
||||
[panel setHasShadow:YES];
|
||||
|
||||
self = [self initWithWindow:panel];
|
||||
|
@ -396,6 +396,6 @@ static const CGFloat kCandidateTextLeftMargin = 8.0;
|
|||
|
||||
[_keyLabelStripView setFrame:NSMakeRect(0.0, 0.0, stripWidth, windowHeight)];
|
||||
[_scrollView setFrame:NSMakeRect(stripWidth + 1.0, 0.0, tableViewStartWidth, windowHeight)];
|
||||
[[self window] setFrame:frameRect display:YES];
|
||||
[[self window] setFrame:frameRect display:NO];
|
||||
}
|
||||
@end
|
||||
|
|
Loading…
Reference in New Issue