andlabs / ui

Platform-native GUI library for Go.
Other
8.33k stars 651 forks source link

Linux: Gtk-CRITICAL gtk_window_resize: assertion 'width > 0' failed #287

Closed drahoslove closed 6 years ago

drahoslove commented 6 years ago

Hi, when I run my program which use ui, one of two thing happens: either it will cause my whole window manager to freeze until I kill the process from another TTY, or it will panics with following message:

(penego:32407): Gtk-CRITICAL **: gtk_window_resize: assertion 'width > 0' failed
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x80ab59]

Distro is Budgie Ubuntu - kernel 4.13.0-38-generic x86_64 GNU/Linux libgtk-3-dev installed, version 3.22.25-0ubuntu0.1 go version go1.10.1 linux/amd64

Any idea what might be the issue?

andlabs commented 6 years ago

That's weird. Can you show some minimal code that reproduces it?

drahoslove commented 6 years ago

Never mind, I was apparently creating NewWindow with zero width. Feel stupid now. Windows version has no problem with zero sized window.

I still have panic due to a segmentation fault, which is another issue, but maybe you might help me with it here?

drahoslove commented 6 years ago

Problem found.

tab := ui.NewTab()
tab.Append("tab", nil)

Append nil tab is not possible with gtk. Again windows is more permissive here.

Sorry for the distraction :)

andlabs commented 6 years ago

Weird. File the window width > 0 thing as a bug on libui please.

As for appending nil to a tab, see andlabs/libui#328.