>> и написан с использованием асинхронной библиотеки XCB вместо Xlib для обеспечения хорошей отзывчивости интерфейса.
> Ну булшит же. Не совсем. Скорее просто "несколько" устаревшая информация.
> openbox как пример невероятно отзывчивого и на xlib.
> и на xlib
Точно нету [xcb]? А если найду? :)
https://github.com/Mikachu/openbox/blob/master/obt/xqueue.c#L90
n = XEventsQueued(obt_display, QueuedAfterFlush) > 0;
sth = FALSE; while ((block && !sth) || n > 0) {
XEvent e;
if (XNextEvent(obt_display, &e) != Success)
Вот вам фокус:
https://github.com/mirror/libX11/blob/master/src/NextEvent.c
int
XNextEvent (
register Display *dpy,
register XEvent *event)
{
...
if (dpy->head == NULL)
_XReadEvents(dpy);
https://github.com/mirror/libX11/blob/master/src/xcb_io.c#L360
void _XReadEvents(Display *dpy)
{
xcb_generic_reply_t *response;
...snip...
event = xcb_wait_for_event(dpy->xcb->connection);
XEventsQueued
https://github.com/mirror/libX11/blob/master/src/Pending.c#L34
https://github.com/mirror/libX11/blob/master/src/xcb_io.c#L331
int _XEventsQueued(Display *dpy, int mode)
{
xcb_generic_reply_t *response;
if(dpy->flags & XlibDisplayIOError)
return 0;
if(dpy->xcb->event_owner != XlibOwnsEventQueue)
XCB таки оказалось эффективнее, причем в некоторых случаях в разы (SSH -X), поэтому и перепилили Xlib:
https://xcb.freedesktop.org/XlibXcb/
> Our experience with XCL convinced us that significant wins were available in providing a library at once binary-compatible with Xlib and built atop XCB. Our second, much more successful attempt at achieving this goal was to rip much of the insides out of stock Xlib and replace it with calls into XCB (and some XCL) code. The result is Xlib/XCB, a library that allows existing application binaries linked against Xlib to run unmodified,
>