tauri-apps / window-vibrancy

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

apply_acrylic does not display properly in windows 22H2 #75

Closed hanmingk closed 1 year ago

hanmingk commented 1 year ago

I tried using this in fltk-rs. Seems to work only for the menu bar. I have tried it on windows 22H1 and it is displayed normally. But this will not work properly in windows 22H2.

# Cargo.toml
[package]
name = "fltk-acrylic"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
fltk = { version = "1.3.22", features = ["rwh05"] }
window-vibrancy = "0.3"
# main.rs
use fltk::{prelude::*, *};
use window_vibrancy::apply_acrylic;

fn main() {
    let a = app::App::default().with_scheme(app::Scheme::Gtk);
    let mut win = window::Window::default().with_size(400, 400);
    win.end();
    win.show();

    apply_acrylic(&win, Some((10, 10, 10, 90))).expect("Unsupported");
    a.run().unwrap();
}

image

amrbashir commented 1 year ago

Are you sure the window is transparent? you need to make sure the window is transparent. for example, try cloning this repo and running:

cargo r --example winit
cargo r --example tao

you can see that in the first example, the window is not transparent, due to a bug in winit but you can see that the effect works fine in tao.

The reason why it worked in 22H1 because we use a different API there which has a lag issues when resizing/moving.