Skip to content

Commit

Permalink
window: maybe fix ghostly artifacts on macos
Browse files Browse the repository at this point in the history
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
  • Loading branch information
wez committed Oct 28, 2020
1 parent 3808cf3 commit e3100c9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion window/src/os/macos/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down

0 comments on commit e3100c9

Please sign in to comment.