spacedrive icon indicating copy to clipboard operation
spacedrive copied to clipboard

Fix macOS shadow on first render

Open maxichrome opened this issue 3 years ago • 1 comments
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. :|

maxichrome avatar May 11 '22 17:05 maxichrome

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

maxichrome avatar May 11 '22 18:05 maxichrome