Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blurry and translucent background on a transparent window #2827

Closed
richardaum opened this issue Oct 31, 2021 · 4 comments
Closed

Blurry and translucent background on a transparent window #2827

richardaum opened this issue Oct 31, 2021 · 4 comments

Comments

@richardaum
Copy link

richardaum commented Oct 31, 2021

Is your feature request related to a problem? Please describe.
I'm trying to use a blurry background on a transparent window element (sidebar).

Describe the solution you'd like
Use backdrop-filter along with a transparent window to achieve a blurry background.

Describe alternatives you've considered
I've also tried to use -webkit-filter: blur(20px), but same thing happens.

Additional context

The following screenshots were taken with a transparent window - transparent: true on tauri.conf.json. The window is in front of my OS wallpaper.

Description Image
On the left side I have a div with backdrop-filter: blur(20px) and also a background: rgba(238, 238, 244, 0.5). On the right side I have another but with background: transparent. image
When I add the same image I use on my OS wallpaper on <body>, the desired blur effect appears. image

Conclusion: The blur effects appears only when the image is part of the application, and doesn't consider what is behind the transparent window. Should it?

Info

  • Linux (Zorin OS)
  • "@tauri-apps/api": "^1.0.0-beta.8"
  • "@tauri-apps/cli": "^1.0.0-beta.10"
tauri.conf.json
{
  "package": {
    "productName": "findr",
    "version": "0.1.0"
  },
  "build": {
    "distDir": "../build",
    "devPath": "http://localhost:3000",
    "beforeDevCommand": "yarn start",
    "beforeBuildCommand": "yarn build"
  },
  "tauri": {
    "bundle": {
      "active": true,
      "targets": "all",
      "identifier": "com.tauri.dev",
      "icon": [
        "icons/32x32.png",
        "icons/128x128.png",
        "icons/128x128@2x.png",
        "icons/icon.icns",
        "icons/icon.ico"
      ],
      "resources": [],
      "externalBin": [],
      "copyright": "",
      "category": "DeveloperTool",
      "shortDescription": "",
      "longDescription": "",
      "deb": {
        "depends": [],
        "useBootstrapper": false
      },
      "macOS": {
        "frameworks": [],
        "minimumSystemVersion": "",
        "useBootstrapper": false,
        "exceptionDomain": "",
        "signingIdentity": null,
        "entitlements": null
      },
      "windows": {
        "certificateThumbprint": null,
        "digestAlgorithm": "sha256",
        "timestampUrl": ""
      }
    },
    "updater": {
      "active": false
    },
    "allowlist": {
      "all": true
    },
    "windows": [
      {
        "title": "Findr",
        "width": 800,
        "height": 600,
        "resizable": true,
        "fullscreen": false,
        "decorations": false,
        "transparent": true
      }
    ],
    "security": {
      "csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'"
    }
  }
}
@amrbashir
Copy link
Member

This is the expected behavior on Linux and Windows, backdrop-filter only affects DOM elements, anything behind the window will not be blurred.

The solution is to blur the window itself. It is not currently implemented and needs to be added in upstream first, subscribe to this tauri-apps/tao#137

@amrbashir
Copy link
Member

amrbashir commented Dec 6, 2021

for anyone interested in this issue, I made a https://github.com/tauri-apps/tauri-plugin-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.

@lucasfernog
Copy link
Member

Closing this since you can try out the plugin from Amr now. The feature might land in tauri v2.

@arialpew
Copy link

@lucasfernog Do we have any news about this for v2 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants