Skip to content

[v3] Dialogs are broken on Linux/GTK3 #5338

@nsychev

Description

@nsychev

Description

Hi!

Recently, GTK4 support was introduced in Wails v3. Among changes, there is this one: 5dc3e21#diff-753b0daa4def34a12fc2825643a61e6d156895e753a600876d05cdf72a69f026R41 (file v3/pkg/application/dialogs_linux.go, line 41: InvokeAsyncgo func())

It causes dialogs to segfault under GTK3.

To Reproduce

  1. Run go run main.go in v3/examples/dialogs on Linux.
  2. Open any dialog.
  3. Click button in the dialog.

App crashes, log: https://gist.github.com/nsychev/1957f31776c267f137d541d10ce3ec40

Expected behaviour

Dialog closes.

Screenshots

No response

Attempted Fixes

AI agent said that in GTK3 dialogs must be dispatched to the main thread, so go func() is incorrect and previous version with InvokeAsync must be used.

After vendoring wails and changing this line, dialogs are working as expected.

System Details

Wails (v3.0.0-alpha.84)  Wails Doctor 
                                                                                                                                                                                 
# System 

┌────────────────────────────────────────────────────────────────────────────────────────────┐
| Name                | Ubuntu                                                               |
| Version             | 24.04                                                                |
| ID                  | ubuntu                                                               |
| Branding            | 24.04.4 LTS (Noble Numbat)                                           |
| Platform            | linux                                                                |
| Architecture        | amd64                                                                |
| Desktop Environment | ubuntu:GNOME                                                         |
| NVIDIA Driver       | N/A                                                                  |
| XDG_SESSION_TYPE    | x11                                                                  |
| CPU                 | 13th Gen Intel(R) Core(TM) i5-1340P                                  |
| GPU 1               | Raptor Lake-P [Iris Xe Graphics] (Intel Corporation) - Driver: i915  |
| Memory              | 15GB                                                                 |
└────────────────────────────────────────────────────────────────────────────────────────────┘

# Build Environment 

┌──────────────────────────────────────────────────────────────────────┐
| Wails CLI      | v3.0.0-alpha.84                                     |
| Go Version     | go1.26.1                                            |
| -buildmode     | exe                                                 |
| -compiler      | gc                                                  |
| CGO_CFLAGS     |                                                     |
| CGO_CPPFLAGS   |                                                     |
| CGO_CXXFLAGS   |                                                     |
| CGO_ENABLED    | 1                                                   |
| CGO_LDFLAGS    |                                                     |
| DefaultGODEBUG | cryptocustomrand=1,tlssecpmlkem=0,urlstrictcolons=0 |
| GOAMD64        | v1                                                  |
| GOARCH         | amd64                                               |
| GOOS           | linux                                               |
└──────────────────────────────────────────────────────────────────────┘

# Dependencies 

┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
| webkitgtk-6.0 (experimental) | [Optional] not installed. Install with: sudo apt install libwebkitgtk-6.0-dev |
| gcc                          | 12.10ubuntu1                                                                  |
| gtk3                         | 3.24.41-4ubuntu1.3                                                            |
| gtk4 (experimental)          | [Optional] not installed. Install with: sudo apt install libgtk-4-dev         |
| npm                          | 11.12.1                                                                       |
| pkg-config                   | 1.8.1-2build1                                                                 |
| webkit2gtk                   | 2.50.4-0ubuntu0.24.04.1                                                       |
| docker                       | *Docker version 29.4.2, build 055a478 (cross-compilation ready)               |
|                                                                                                              |
└────────────────────────────────────────── * - Optional Dependency ───────────────────────────────────────────┘

# Checking for issues 

 SUCCESS  No issues found

# Diagnosis 

 SUCCESS  Your system is ready for Wails development!

Need documentation? Run: wails3 docs
 ♥   If Wails is useful to you or your company, please consider sponsoring the project: wails3 sponsor

Additional context

In GTK4 go func() is working fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingLinuxv3

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions