andlabs / andlabs/libui

[xcb] Unknown sequence number while processing queue - XInitThreads

Offen
#200 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C
Sterne
10.9k
Forks
612
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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](https://github.com/beijaflor-io/haskell-libui/blob/master/examples/ReactiveBananaClickToResize.hs) multi-threaded example, I get the following exception on Linux:

```
[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
libui-reactive-banana-click-to-resize: xcb_io.c:274: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
```

Indeed `XInitThreads` does't seem to be called in `libui/unix/main.c` in `uiInit`. 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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.