tao
tao copied to clipboard
window vibrancy feature
it will be great to see window vibrancy feature in Tauri Here is some examples that made in electron
https://github.com/arkenthera/electron-vibrancy https://github.com/Seo-Rii/electron-acrylic-window/blob/master/src/native/win10.cpp
For macOS it should be quite easy; https://developer.apple.com/documentation/appkit/nsvisualeffectview?language=objc
On Linux, transparency/blur is usually used by the user compositor and we can't control that, however I think I've seen some apps before that use clever tricks to workaround this (I need to do more research). There is also some news about gtk4 has some blur effect but since I haven't tried it at all, it might not be the expected behavior. IMO I don't think we should support Linux for this, too much work and users can easily configure their compositer.
On Windows:
-
win7
supportsblur
only (DWMEnableBlurBehind
). -
win8
doesn't support anyblur
method, not to my knowledge at least. -
win10
supportsblur
on all versions I think without any problems. It also supportsacrylic
but only onwin10 v1809+
and it will have lags when resizing/moving the window (SetWindowCompositionAttribute
). -
win11
is the same aswin10
but also supportsmica
(DwmSetWindowAttribute
).
I'm going to upgrade to gtk4 and see how it goes? If that works well, maybe we could add this later.
Note that Windows 11 also has undocumented APIs for enabling the new Mica blur effects as well.
@Tropix126 is it SetWindowCompositionAttribute
or something else ?
Edit: According to this comment, seems like there is a new variant in dwmapi.h
that can be used with DwmSetWindowAttribute
but it is still in preview sdk and not stable.
for anyone interested in this issue, I made a https://github.com/tauri-apps/window-vibrancy to experiment with the feature. it supports tao and tauri and I'd appreciate feedback on different Windows versions, macOS support will be added later.
Edit: macOS is now supported.
The lastest insider build of Windows 11 (22523) just got public facing Win32 APIs for Mica and Acrylic composition effects respectively under DWMWA_SYSTEMBACKDROP_TYPE
:
https://twitter.com/StartIsBack/status/1471262840313065474/
Closing this as https://github.com/tauri-apps/window-vibrancy is enough and will try to include it in tauri@v2 by default.
Closing this as https://github.com/tauri-apps/window-vibrancy is enough and will try to include it in tauri@v2 by default.
Hopefully with Linux support?
Hopefully with Linux support?
To our knowledge the note in the readme is still accurate, at least if we don't want to force users to install gnome extensions. We'd love to be proven wrong about that though, so if you know something we don't, please reach out to us!