Open yamadapc opened 8 years ago
Note
Just to be clear, even though there're multiple threads in Haskell-land, that code is using uiQueueMain
on every UI update, and even adding a lock so uiQueueMain
was only called once at a time (which seemed closer to the C++ example in this repository, though I can't really tell) didn't fix the issue.
EDIT - So I don't spam 164 people again
Actually, there're more details... Maybe it's exclusive to the Haskell bindings. If you never get this bug I should just close this issue. I forgot my version of uiMain
was ticking the UI loop from Haskell, so it could be interrupted by other threads.
Sorry for not writing everything in one comment.
There is no way to pin uiMain()
to a thread in Haskell? If there is, you could hack around it using uiQueueMain()
.
Hey there, I've been working on Haskell bindings as well as extensions to this library on https://github.com/beijaflor-io/haskell-libui
Upon running a FRP click-to-resize multi-threaded example, I get the following exception on Linux:
Indeed
XInitThreads
does't seem to be called inlibui/unix/main.c
inuiInit
. Adding it fixed the problem for me.Here's a patch to do it: https://gist.github.com/c6f4f0bc5fa5aec33bb83ac2d4c53f3d
I'm unfamiliar with the build system here and had to re-instruct Haskell's build system to work anyway, so I don't need any other changes but this for the bindings to work, but I'm open to submitting a PR with a fix to discuss, understand and fix the issue.