spacedrive
spacedrive copied to clipboard
Fix macOS shadow on first render
trafficstars
For some reason, calling NSWindow::invalidateShadow doesn't recompute the native shadow on macOS — you have to resize the window for the native shadow to display. :|
I attempted to debug this by adding a 1-second delay after app render, then calling a custom fix_shadow function:
https://github.com/spacedriveapp/spacedrive/blob/c73c175cf0a5e81f5d3f514365109f2af45f492a/apps/desktop/src-tauri/src/main.rs#L48-L50
Which subsequently runs NSWindow::invalidateShadow():
https://github.com/spacedriveapp/spacedrive/blob/db312269abd99f1d54ab010bda1c3a002853feb3/apps/desktop/src-tauri/src/window.rs#L97-L101
But still no luck until the window is resized