[windows] ignore mouse events

This commit is contained in:
Lea Anthony
2023-10-23 20:58:55 +11:00
parent e661052c89
commit 3422c40e19
3 changed files with 32 additions and 0 deletions
@@ -115,6 +115,9 @@ type WebviewWindowOptions struct {
// KeyBindings is a map of key bindings to functions
KeyBindings map[string]func(window *WebviewWindow)
// IgnoreMouseEvents will ignore mouse events in the window
IgnoreMouseEvents bool
}
var WebviewWindowDefaults = &WebviewWindowOptions{
@@ -179,6 +179,9 @@ func (w *windowsWebviewWindow) run() {
exStyle = w32.WS_EX_CONTROLPARENT
if options.BackgroundType != BackgroundTypeSolid {
exStyle |= w32.WS_EX_NOREDIRECTIONBITMAP
if w.parent.options.IgnoreMouseEvents {
exStyle |= w32.WS_EX_TRANSPARENT | w32.WS_EX_LAYERED
}
}
if options.AlwaysOnTop {
exStyle |= w32.WS_EX_TOPMOST