window: alternative shadow/ghost/macos fix

This one invalidates the shadow when we invalidate the window,
so we should get to keep the shadow and lose the ghosts.

refs: #310
This commit is contained in:
Wez Furlong committed 2020-10-28 16:08:33 -07:00
1 parent e3100c937f
commit f2b504ee1f
1 file changed
+4 -4
+4 -4
View File
@@ -405,10 +405,6 @@ impl Window {
window.setReleasedWhenClosed_(NO);
window.setOpaque_(NO);
// Turn off the window shadow, because when the background is transparent
// having the shadow enabled seems to correlate with ghostly remnants
// see: https://github.com/wez/wezterm/issues/310
window.setHasShadow_(NO);
let ns_color: id = msg_send![Class::get("NSColor").unwrap(), alloc];
window.setBackgroundColor_(cocoa::appkit::NSColor::clearColor(ns_color));
@@ -667,6 +663,10 @@ impl WindowOpsMut for WindowInner {
fn invalidate(&mut self) {
unsafe {
let () = msg_send![*self.view, setNeedsDisplay: YES];
// Explicitly invalidate the window shadow to avoid
// leaving behind ghost remnants!
// see: https://github.com/wez/wezterm/issues/310
NSWindow::invalidateShadow(*self.window);
}
}
fn set_title(&mut self, title: &str) {