hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
19.72k stars 838 forks source link

No blur on semi-transparent electron app #1332

Closed KZDKM closed 1 year ago

KZDKM commented 1 year ago

For those who are not familiar with the app, its Obsidian.md, a electron-based note-taking app (proprietary only)

Not a big problem for me now because the opacity 0.99 hack works, but I think there might be a bug that affects the blurring of other semi-transparent electron apps so I figured I should report on it anyways.

The app is not running via XWayland. Also worth noting that translucency is not supported by Obsidian on linux, I'm editing the theme css file so that the windows becomes transparent.

I'm not familiar with the c++ API, but I'm guessing that its because the pWindow returns alpha value of 1, but it should still be handled correctly because of /src/render/OpenGL.cpp:windowShouldBeBlurred function? specifically:

if (!pixman_region32_not_empty(&inverseOpaque)) {

which I think is there to handle semi-transparent windows?

Any Ideas? Thanks!

vaxerski commented 1 year ago

most likely obsidian reports a fully opaque window when in reality it is not.

Are you launching it in native wayland? What happens if it's in XWayland?

KZDKM commented 1 year ago

XWayland just dont allow the app to be transparent at all, and it is blurry as I use 2x scaling.

vaxerski commented 1 year ago

I've read your unixporn post.

Since obsidian never expects transparency, it sets an opaque region to be the full surface area. This means it reports to hyprland as fully opaque

Not much I can do bout that. Guess you have to use your workaround

KZDKM commented 1 year ago

Yeah that's what I've speculated, technically the app could have transparency but reports alpha=1. The biggest problem with my workaround is that the app dont get blur under full screen as the opacity is overridden. This could be an issue for other apps as well so a new forceblur window rule would come in handy? I could submit a PR.

vaxerski commented 1 year ago

making windowrules for opacity 3-arg could be an option (act/inact/full)