diff --git a/mkdocs-website/docs/en/changelog.md b/mkdocs-website/docs/en/changelog.md index c380987a5af..0518eafca97 100644 --- a/mkdocs-website/docs/en/changelog.md +++ b/mkdocs-website/docs/en/changelog.md @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Services have been expanded to provide plugin functionality. By [atterpac](https://github.com/atterpac) and [leaanthony](https://github.com/leaanthony) in [#3570](https://github.com/wailsapp/wails/pull/3570) ### Fixed +- [linux] Fixed linux compile error introduced by IgnoreMouseEvents addition by [atterpac](https://github.com/atterpac) in [#3721](https://github.com/wailsapp/wails/pull/3721) - [windows] Fixed syso icon file generation bug by [atterpac](https://github.com/atterpac) in [#3675](https://github.com/wailsapp/wails/pull/3675) - [linux] Fix to run natively in wayland incorporated from [#1811](https://github.com/wailsapp/wails/pull/1811) in [#3614](https://github.com/wailsapp/wails/pull/3614) by [@stendler](https://github.com/stendler) - [windows] Fixed system tray startup panic in [#3693](https://github.com/wailsapp/wails/issues/3693) by [@DeltaLaboratory](https://github.com/DeltaLaboratory) diff --git a/v3/pkg/application/linux_cgo.go b/v3/pkg/application/linux_cgo.go index f55daa71117..29e3f75fdcf 100644 --- a/v3/pkg/application/linux_cgo.go +++ b/v3/pkg/application/linux_cgo.go @@ -1373,6 +1373,14 @@ func (w *linuxWebviewWindow) position() (int, int) { return int(x), int(y) } +func (w *linuxWebviewWindow) ignoreMouse(ignore bool) { + if ignore { + C.gtk_widget_set_events((*C.GtkWidget)(unsafe.Pointer(w.window)), C.GDK_ENTER_NOTIFY_MASK|C.GDK_LEAVE_NOTIFY_MASK) + } else { + C.gtk_widget_set_events((*C.GtkWidget)(unsafe.Pointer(w.window)), C.GDK_ALL_EVENTS_MASK) + } +} + // FIXME Change this to reflect mouse button! // //export onButtonEvent diff --git a/v3/pkg/application/webview_window_linux.go b/v3/pkg/application/webview_window_linux.go index cb7c7744fa0..22ede469603 100644 --- a/v3/pkg/application/webview_window_linux.go +++ b/v3/pkg/application/webview_window_linux.go @@ -2,8 +2,7 @@ package application -import "C" -import ( +import ( "fmt" "time" @@ -282,7 +281,7 @@ func (w *linuxWebviewWindow) run() { } // Ignore mouse events if requested - w.setIgnoreMouseEvents(options.IgnoreMouseEvents) + w.setIgnoreMouseEvents(w.parent.options.IgnoreMouseEvents) startURL, err := assetserver.GetStartURL(w.parent.options.URL) if err != nil { @@ -375,11 +374,5 @@ func (w *linuxWebviewWindow) isIgnoreMouseEvents() bool { } func (w *linuxWebviewWindow) setIgnoreMouseEvents(ignore bool) { - w.ignoreMouseEvents = ignore - - if ignore { - C.gtk_widget_set_events((*C.GtkWidget)(unsafe.Pointer(w.window)), C.GDK_ENTER_NOTIFY_MASK|C.GDK_LEAVE_NOTIFY_MASK) - } else { - C.gtk_widget_set_events((*C.GtkWidget)(unsafe.Pointer(w.window)), C.GDK_ALL_EVENTS_MASK) - } + w.ignoreMouse(w.ignoreMouseEvents) }