tauri-apps / window-vibrancy

Make your windows vibrant.
Apache License 2.0
624 stars 32 forks source link

Using the apply_vibrancy on macOS on focus change window is no longer transparent #88

Closed MadsFrost closed 1 year ago

MadsFrost commented 1 year ago

Hi, how do I fix the apply_vibrancy on "non-focused" the window goes back to not being transparent?

"apply_vibrancy(&window, NSVisualEffectMaterial::HudWindow, None, None)"

Examples attached: Non-focused:

Screenshot 2023-06-01 at 14 34 15

Focused:

Screenshot 2023-06-01 at 14 34 43
FabianLars commented 1 year ago

You have to provide a "state" arg in the apply_vibrancy function. Something like this

apply_vibrancy(&window, NSVisualEffectMaterial::HudWindow, Some(NSVisualEffectState::Active), None);
MadsFrost commented 1 year ago

You have to provide a "state" arg in the apply_vibrancy function. Something like this

apply_vibrancy(&window, NSVisualEffectMaterial::HudWindow, Some(NSVisualEffectState::Active), None);

Ah thank you @FabianLars