Git Product home page Git Product logo

Comments (13)

FabianLars avatar FabianLars commented on May 20, 2024 2

@alexgraddev if you're on macos: Did you enable the private apis? It's necessary for transparency, see: https://tauri.app/v1/api/config#tauriconfig.macosprivateapi

from window-vibrancy.

gradddev avatar gradddev commented on May 20, 2024 2

@FabianLars, didn't know about it. Now it works. Thank you!

P.S. I think it should be in the window-vibrancy documentation, or at least in the example for the Tauri.

from window-vibrancy.

hgl avatar hgl commented on May 20, 2024

I did some experiments:

Given the empty window, if I drag the mouse through where the heading should be and right click, the menu prompts me to search for the text.
Screen Shot 2022-07-08 at 9 33 55 AM

If I remove this line, then the content is correctly displayed, but without vibrancy:

let _: () = msg_send![ns_view, addSubview: blurred_view positioned: NSWindowOrderingMode::NSWindowBelow relativeTo: 0];

It seems the issue stems from the vibrancy view covering the webkit view.

I wonder if the latest version of tauri, or its creation of the webkit view for macOS 10.13.6 is special, which causes this plugin to add the subview first?

from window-vibrancy.

amrbashir avatar amrbashir commented on May 20, 2024

can you try applying the effect in the Ready event

from window-vibrancy.

hgl avatar hgl commented on May 20, 2024

I tried this, same result:

fn main() {
    let context = tauri::generate_context!();
    tauri::Builder::default()
        .menu(if cfg!(target_os = "macos") {
            tauri::Menu::os_default(&context.package_info().name)
        } else {
            tauri::Menu::default()
        })
        .build(context)
        .expect("error while running tauri application")
        .run(|app_handle, event| match event {
            tauri::RunEvent::Ready {} => {
                let window = app_handle.get_window("main").unwrap();

                #[cfg(target_os = "macos")]
                apply_vibrancy(&window, NSVisualEffectMaterial::Sidebar)
                    .expect("Unsupported platform! 'apply_vibrancy' is only supported on macOS");
            }
            _ => {}
        });
}

from window-vibrancy.

gradddev avatar gradddev commented on May 20, 2024

I have the same issue I think. The WebView background is white. Even if I set it to transparent using CSS. Also I see a vibrancy for a split second when the window is showing.

from window-vibrancy.

lorenzolewis avatar lorenzolewis commented on May 20, 2024

Is there a way it can check that and output a message to console if it isn't enabled?

from window-vibrancy.

FabianLars avatar FabianLars commented on May 20, 2024

Yes that would be possible, but imo it should be enough that every transparency api doc mentions it, right?

p.s. i guess adding it to the readme/example here is fair tho? idk

from window-vibrancy.

amrbashir avatar amrbashir commented on May 20, 2024

I think the api doc for transparent is enough. This plugin shouldn't care how you enable transparency for your window.

from window-vibrancy.

hgl avatar hgl commented on May 20, 2024

I don't think I'm experiencing the same issue as @alexgraddev did.

I have set tauri.macOSPrivateApi to true in src-tauri/tauri.conf.json, same result, and I don't see any white background of web view or vibrancy window for a split second. The vibrancy window always covers everything.

from window-vibrancy.

iujlaki avatar iujlaki commented on May 20, 2024

I don't think I'm experiencing the same issue as @alexgraddev did.

I have set tauri.macOSPrivateApi to true in src-tauri/tauri.conf.json, same result, and I don't see any white background of web view or vibrancy window for a split second. The vibrancy window always covers everything.

I had the same, just added this line to tauri.conf.json and it works now:
https://github.com/tauri-apps/window-vibrancy/blob/dev/examples/tauri/src-tauri/tauri.conf.json#L57

from window-vibrancy.

VojGin avatar VojGin commented on May 20, 2024

@alexgraddev if you're on macos: Did you enable the private apis? It's necessary for transparency, see: https://tauri.app/v1/api/config#tauriconfig.macosprivateapi

I enabled macOSPrivateApi, set "transparent": true and it works now. https://github.com/tauri-apps/window-vibrancy/blob/dev/examples/tauri/src-tauri/tauri.conf.json#L57

from window-vibrancy.

VojGin avatar VojGin commented on May 20, 2024

Edited the readme instructions mentioning these additional steps. #116

from window-vibrancy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.