summaryrefslogtreecommitdiffstats
path: root/glow
diff options
context:
space:
mode:
authorLibravatar Ildar Akhmetgaleev <akhilman@gmail.com>2021-09-02 19:38:41 +0700
committerLibravatar Ildar Akhmetgaleev <akhilman@gmail.com>2021-09-02 21:18:12 +0700
commit666f676d7c3cb83f51a004da7ef62f82b0365b1f (patch)
tree6083321be9862533522b2366981c9f7815ceabbd /glow
parent7ebdbec8e7a2932e085ecd7fa36acc5bc8740cd7 (diff)
downloadiced-666f676d7c3cb83f51a004da7ef62f82b0365b1f.tar.gz
iced-666f676d7c3cb83f51a004da7ef62f82b0365b1f.tar.bz2
iced-666f676d7c3cb83f51a004da7ef62f82b0365b1f.zip
Fix window holes behind transparent objects
Without this change, the transparent objects composed over the opaque background creates the transparency of the entire window through which the desktop wallpaper could be seen. This problem manifested itself with glow backend and wayland compositor (gnome). This patch completely eliminates this problem. With it, the final image produced by glow backend corresponds to the image produced by the wgpu backend. Fixes #1018
Diffstat (limited to 'glow')
-rw-r--r--glow/src/window/compositor.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/glow/src/window/compositor.rs b/glow/src/window/compositor.rs
index 1fb671ad..b8157f78 100644
--- a/glow/src/window/compositor.rs
+++ b/glow/src/window/compositor.rs
@@ -26,7 +26,12 @@ impl iced_graphics::window::GLCompositor for Compositor {
// Enable alpha blending
gl.enable(glow::BLEND);
- gl.blend_func(glow::SRC_ALPHA, glow::ONE_MINUS_SRC_ALPHA);
+ gl.blend_func_separate(
+ glow::SRC_ALPHA,
+ glow::ONE_MINUS_SRC_ALPHA,
+ glow::ONE,
+ glow::ONE_MINUS_SRC_ALPHA,
+ );
// Disable multisampling by default
gl.disable(glow::MULTISAMPLE);