Skip to content

Commit

Permalink
linux: fix gtk3 segfault
Browse files Browse the repository at this point in the history
Hopefully fixes the segfaults related to using dialog in conjunction
with glfw, AllenDang/giu, and other imgui libraries.

Fixes #51. Fixes #58.
  • Loading branch information
sqweek committed Oct 2, 2021
1 parent aa40666 commit 9a201b5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dlgs_linux.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package dialog

// #cgo pkg-config: gtk+-3.0
// #cgo LDFLAGS: -lX11
// #include <X11/Xlib.h>
// #include <gtk/gtk.h>
// #include <stdlib.h>
// static GtkWidget* msgdlg(GtkWindow *parent, GtkDialogFlags flags, GtkMessageType type, GtkButtonsType buttons, char *msg) {
Expand All @@ -13,6 +15,7 @@ import "C"
import "unsafe"

func init() {
C.XInitThreads()
C.gtk_init(nil, nil)
}

Expand Down

0 comments on commit 9a201b5

Please sign in to comment.