macOS: Disable OS window shadows for transparent windows as they cause rendering artifacts due to Cocoa bugs

Fixes #6439
This commit is contained in:
Kovid Goyal
2023-07-22 11:20:37 +05:30
parent dcdc676719
commit 630101204b
5 changed files with 6 additions and 34 deletions

View File

@@ -3029,6 +3029,9 @@ GLFWAPI void glfwCocoaSetWindowChrome(GLFWwindow *w, unsigned int color, bool us
has_shadow = true;
break;
}
// shadow causes burn-in/ghosting because cocoa doesnt invalidate it on OS window resize/minimize/restore.
// https://github.com/kovidgoyal/kitty/issues/6439
if (is_transparent) has_shadow = false;
bool hide_titlebar_buttons = !in_fullscreen && window->ns.titlebar_hidden;
[window->ns.object setTitlebarAppearsTransparent:titlebar_transparent];
[window->ns.object setHasShadow:has_shadow];