1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-13 07:22:52 +03:00

window: maybe fix ghostly artifacts on macos

Not 100% sure that this is it, but it seems much less likely that
artifacts will appear in conjunction with transparency when the window
shadow effect is disabled; I didn't see the ghosting with this disabled,
but I sometimes dididn't see it with it enabled, so I'm not sure that we
have a 100% reliable reproduction, and thus am not sure that this is a
fix.

I found mention of disabling the shadow in some example code on
stackoverflow when I was first researching this, but it wasn't supplied
with an explanation. Perhaps this is why?

Longer term we might want to be smarter about turning off the shadow
only when the opacity is != 1.0, but at the moment the window layer
can't see the config, so let's just default it off for the moment
until we see if it does the trick.

refs: #310
This commit is contained in:
Wez Furlong 2020-10-28 14:08:04 -07:00
parent 3808cf3f58
commit e3100c937f

View File

@ -405,7 +405,10 @@ impl Window {
window.setReleasedWhenClosed_(NO);
window.setOpaque_(NO);
// window.setHasShadow_(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));