diff --git a/v2/internal/frontend/desktop/linux/window.go b/v2/internal/frontend/desktop/linux/window.go index dd087f57e..774594707 100644 --- a/v2/internal/frontend/desktop/linux/window.go +++ b/v2/internal/frontend/desktop/linux/window.go @@ -173,7 +173,9 @@ func (w *Window) Center() { } func (w *Window) SetPosition(x int, y int) { - C.SetPosition(unsafe.Pointer(w.asGTKWindow()), C.int(x), C.int(y)) + invokeOnMainThread(func() { + C.SetPosition(unsafe.Pointer(w.asGTKWindow()), C.int(x), C.int(y)) + }) } func (w *Window) Size() (int, int) { diff --git a/website/src/pages/changelog.mdx b/website/src/pages/changelog.mdx index 69430f887..385cfb931 100644 --- a/website/src/pages/changelog.mdx +++ b/website/src/pages/changelog.mdx @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Avoid app crashing when the Linux GTK key is empty. Fixed by @aminya in [PR](https://github.com/wailsapp/wails/pull/2672) +- Fixed a race condition when positioning the window on Linux. Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2850) ### Added