-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[v2] Can the background be transparent? #1296
Comments
Hi! It looks like you are trying to open a ticket but haven't provided enough details.
|
@leaanthony |
It can be fully transparent, but you're not providing any information that the ticket template requests, such as platform. |
I have tested it many times on the windows platform, and it has always been impossible. I originally thought this was intentionally restricted.😂 |
It's possible on Windows just not exposed. It's also supported if you're running windows preview. The problem is, there's no indication on this ticket what OS the poster is talking about. If you are using v2, please include the output of wails doctor |
It's my fault, I did forget to specify the platform |
|
I really don't understand what you want, wails doctor I've appended at the end of the question, or do you want to know the version number?
|
I've met the same issue when tried to make my window background transparent. The solution provided in the first post (adding So before adding My initial goal was to make window borders rounded (on Windows 10 and below), as a workaround for PC's without DWM composition I used |
@NanoNik Is this something you could consider making a PR for? |
@leaanthony I'll see what I can do with it in a few days |
@NanoNik still interested in this? |
@leaanthony Yes, I'm still intrested in this feature, actually I already use somewhat transparent window in production, but on some systems (especially running Windows 7) even with DWM enabled sometimes it's just doesn't work, so I'm not really sure how to fix or debug it. I was able to reproduce it in a VM only with DWM disabled. |
Is it still impossible to achieve transparent windows on Windows? |
any news on the transparent issue? |
This has been implemented for v3. If anyone wants to backport, please raise a PR 👍 |
Hello, we've been able to set full transparency on Windows 10 and Windows 11 with the following code : import (
"github.com/lxn/win"
)
// other code ...
func (a *App) startup(ctx context.Context) {
hwnd := win.FindWindow(nil, syscall.StringToUTF16Ptr("Your App Title"))
win.SetWindowLong(hwnd, win.GWL_EXSTYLE, win.GetWindowLong(hwnd, win.GWL_EXSTYLE)|win.WS_EX_LAYERED)
} and set this in err = wails.Run(&options.App{
...your_options,
BackgroundColour: &options.RGBA{R: 0, G: 0, B: 0, A: 0},
Windows: &windows.Options{
WebviewIsTransparent: true,
WindowIsTranslucent: false,
}
}) |
I am very happy to see that the effect I want to see is achieved on Windows, but now I want to ask a slightly off-topic question. Can parameters similar to WebviewIsTransparent be implemented on Linux? The current situation is that only the WindowIsTranslucent parameter is available, so in Linux , either create a window with both background color and shadow, or remove both, which means that if I want to create a window with rounded corners, I can only remove the background color and shadow at the same time, so I need to implement the window shadow effect by myself, but in fact I did not find the parameters to set the window shadow in options. So I would like to know Are there any plans now to implement the WebviewIsTransparent parameter on Linux as well? Some necessary information below
|
Does not work for me, the window is always showing the background color set in main.go without the 0 alpha on windows 11. Is there something else that must be taken care of?
|
@jrtp Did you replace |
v2@latest
I can only make the window semi-transparent, but can I make it fully transparent?
I don't know if you understand it, and if not, I can't explain more
Disable WindowIsTranslucent
The text was updated successfully, but these errors were encountered: