floem icon indicating copy to clipboard operation
floem copied to clipboard

Support for Transparent Windows

Open GPeaky opened this issue 1 year ago • 9 comments

Hello, i am making a desktop app that need some windows in transparent mode because they are builded above of a game. Making like an external overlay and i don´t actually know if floem have support for it

GPeaky avatar Dec 17 '23 23:12 GPeaky

In windows

GPeaky avatar Dec 17 '23 23:12 GPeaky

All windows in floem are transparent by default

panekj avatar Dec 18 '23 00:12 panekj

Okay!, thanks i will try it. Floem have better performance than other options like tauri?

GPeaky avatar Dec 18 '23 10:12 GPeaky

Can you share what you end up with here once you got something transparent working. I'd love to use it too and maybe add it to the examples too

dominikwilkowski avatar Dec 18 '23 19:12 dominikwilkowski

Screenshot 2023-12-18 210120

All the leaderboards, etc. are external to the game, and are fully transparent (The game in running in a windowed Fullscreen)

GPeaky avatar Dec 18 '23 20:12 GPeaky

Can you share the code for the transparent window?

dominikwilkowski avatar Dec 18 '23 20:12 dominikwilkowski

This is what an example doit in tauri, i am trying to make it work with floem, but at the moment i could not doit

GPeaky avatar Dec 18 '23 20:12 GPeaky

@GPeaky the issue is here https://github.com/lapce/floem/blob/7e78abb06eac12609d661728ce2fbb0064d5451d/vger/src/lib.rs#L99

The issue is that vger auto selects the blend mode for the alpha channel and by default sets it to opaque and makes it so that windows aren't transparent. On macOS i need to change this to PostMultiplied in order to get it to work.

This should be fixable in a configurable way but I'm not sure how

jrmoulton avatar Dec 18 '23 20:12 jrmoulton

After changing to PostMultiplied and setting my backround color to have a 70% alpha. Screenshot 2023-12-18 at 1 58 21 PM

I think this setting is platform dependent. @dzhou121 might know more

jrmoulton avatar Dec 18 '23 20:12 jrmoulton