commit 622152ee42a310876f10602601206954b8d0613e
Author: Matt Turner <mattst88@gmail.com>
Date:   Fri Apr 12 12:35:55 2024 -0400

    libxcb 1.17.0

commit 4574ab269b082bf412e1b6fb5f09daf8134acd0b
Author: Matt Turner <mattst88@gmail.com>
Date:   Fri Apr 12 12:35:32 2024 -0400

    configure.ac: Require xcb-proto >= 1.17.0
    
    Signed-off-by: Matt Turner <mattst88@gmail.com>

commit b78d304531bfe2359baf40db06099d9158d398d4
Author: Uli Schlachter <psychon@znc.in>
Date:   Sun Sep 17 12:43:43 2023 +0200

    Always write C code in UTF-8
    
    Some people apparently use non-utf8 locales and this caused errors when
    xcb-proto started using some "fancy" quote marks. Fix this by always
    using utf8 encoding.
    
    Fixes: https://gitlab.freedesktop.org/xorg/lib/libxcb/-/issues/72
    Signed-off-by: Uli Schlachter <psychon@znc.in>

commit 389f22d1cb53e47337e96d9f78a3ef0001e8e588
Author: Erik Kurzinger <ekurzinger@nvidia.com>
Date:   Wed Mar 20 07:06:01 2024 -0700

    Add xcb-dri3 dependency to xcb-present.pc.in
    
    Present version 1.4 introduces a dependency on DRI3 for the DRI3Syncobj
    protocol type.
    
    Signed-off-by: Erik Kurzinger <ekurzinger@nvidia.com>

commit 86a478032ba93f30adbc0ce96eecd3420fdf7ed1
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Sat Mar 2 12:01:54 2024 -0800

    xcb_popcount: Use __builtin_popcount if compiler supports it
    
    If the compiler knows of a better implementation for counting the number
    of bits set in a word for the target CPU, let it use that, instead of the
    classic algorithm optimized for PDP-6.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

commit c268499c305317d2e9a67cc590c9147e11438fc7
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Sat Mar 2 11:47:47 2024 -0800

    tests: fix -Werror=discarded-qualifiers errors in check_public.c
    
    check_public.c: In function ‘parse_display_pass’:
    check_public.c:32:32: error: passing argument 1 of ‘putenv’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
       32 |                         putenv("DISPLAY=");
          |                                ^~~~~~~~~~
    In file included from check_public.c:4:
    /usr/include/stdlib.h:148:19: note: expected ‘char *’ but argument is of type ‘const char *’
      148 | extern int putenv(char *);
          |                   ^~~~~~
    check_public.c:57:16: error: passing argument 1 of ‘putenv’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
       57 |         putenv("DISPLAY=");
          |                ^~~~~~~~~~
    /usr/include/stdlib.h:148:19: note: expected ‘char *’ but argument is of type ‘const char *’
      148 | extern int putenv(char *);
          |                   ^~~~~~
    check_public.c: In function ‘parse_display_fail’:
    check_public.c:73:32: error: passing argument 1 of ‘putenv’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
       73 |                         putenv("DISPLAY=");
          |                                ^~~~~~~~~~
    /usr/include/stdlib.h:148:19: note: expected ‘char *’ but argument is of type ‘const char *’
      148 | extern int putenv(char *);
          |                   ^~~~~~
    check_public.c:99:16: error: passing argument 1 of ‘putenv’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
       99 |         putenv("DISPLAY=");
          |                ^~~~~~~~~~
    /usr/include/stdlib.h:148:19: note: expected ‘char *’ but argument is of type ‘const char *’
      148 | extern int putenv(char *);
          |                   ^~~~~~
    check_public.c: In function ‘public_suite’:
    check_public.c:244:16: error: passing argument 1 of ‘putenv’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
      244 |         putenv("DISPLAY=");
          |                ^~~~~~~~~~
    /usr/include/stdlib.h:148:19: note: expected ‘char *’ but argument is of type ‘const char *’
      148 | extern int putenv(char *);
          |                   ^~~~~~
    cc1: all warnings being treated as errors
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

commit c671b9b30aecada4e43cb48e0dee46d19fb5cb9c
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Sat Mar 2 11:13:37 2024 -0800

    libxcb 1.16.1
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

commit 3c946010c8521497b0fba2c8bc9bde184622345a
Author: Fergus Dall <sidereal@google.com>
Date:   Tue Nov 7 17:42:42 2023 +1100

    Enable large file support
    
    Signed-off-by: Fergus Dall <sidereal@google.com>

commit 02a7bbed391859c79864b9aacf040d84f103d38a
Author: Peter Williams <peter@newton.cx>
Date:   Thu Aug 24 21:50:29 2023 -0400

    Fix compilation on Windows
    
    Merge request !30 broke compilation on Windows by introducing unbalanced
    curly braces. This change restores the previous behavior on Windows:
    only TCP is supported.

commit 18c3f055e7c02db6f15ae56f6995639635d1b055
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Sun Aug 20 11:34:31 2023 -0700

    gitlab CI: use latest xcbproto from git to build against
    
    Closes issue #70
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

commit 453115f7eeb694de9f41ea842a29bbb31b90c8dd
Author: Thomas Klausner <wiz@gatalith.at>
Date:   Sat Aug 19 19:34:51 2023 +0200

    configure.ac: drop `pthread-stubs` dependency on NetBSD

commit f11691a09893d2329948521e32a18c13b0b03d01
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Sun Aug 20 10:22:19 2023 -0700

    gitlab CI: regenerate container used for builds
    
    This updates the included xcb-proto to the newly required 1.16.
    As explained in issue #70, this is a quick workaround, not the
    long-term fix for this problem.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

commit cc4b93c9cd93bad15b7106747b0213e4b9c53a1c
Author: Matt Turner <mattst88@gmail.com>
Date:   Wed Aug 16 16:09:50 2023 -0400

    libxcb 1.16
    
    Signed-off-by: Matt Turner <mattst88@gmail.com>

commit 1519334652837cb7b2a8f8117628ea3cc744f7cb
Author: Matt Turner <mattst88@gmail.com>
Date:   Wed Aug 16 16:08:46 2023 -0400

    configure.ac: Require xcb-proto >= 1.16.0
    
    Signed-off-by: Matt Turner <mattst88@gmail.com>

commit 038636786ad1914f3daf3503ae9611f40dffbb8f
Author: Ilya Pominov <ipominov@astralinux.ru>
Date:   Sun Apr 2 11:35:16 2023 +0300

    c_client: Fix crash in xcb_randr_set_monitor
    
    Take into account c_need_sizeof when evaluating
    xcb_protocol_request_t.count
    
    Incorrect xcb_protocol_request_t.count causes a segmentation fault when
    calling functions:
    - xcb_randr_set_monitor{_checked}
    - xcb_input_change_feedback_control{_checked}
    - xcb_input_change_device_control{_unchecked}
    
    Steps to reproduce:
    Call xcb_randr_set_monitor() with valid arguments
    
    OBSERVED RESULT
    Segmentation fault
    ```
    Process terminating with default action of signal 11 (SIGSEGV)
      Access not within mapped region at address 0x780
        at 0x4852925: memmove (in /usr/libexec/valgrind/vgpreload_memcheck-
    amd64-linux.so)
        by 0x486967C: memcpy (string_fortified.h:29)
        by 0x486967C: send_request (xcb_out.c:59)
        by 0x486967C: send_request (xcb_out.c:46)
        by 0x486967C: xcb_send_request_with_fds64 (xcb_out.c:338)
        by 0x48699FC: xcb_send_request (xcb_out.c:359)
        by 0x4891F11: xcb_randr_set_monitor_checked (randr.c:5350)
    ```
    
    EXPECTED RESULT
    Function returns cookie
    
    Amend: 77b594f9583ea0247ff27130316d8e045da7f921
    
    Signed-off-by: Ilya Pominov <ipominov@astralinux.ru>

commit 8935793f1f3751a6aa9d78955c7d6236177986de
Author: Demi Marie Obenour <demiobenour@gmail.com>
Date:   Sat Mar 25 15:27:33 2023 -0400

    Add tests for unix socket parsing
    
    Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>

commit 095255531b90f0b442e6ca41fb3752a058562d07
Author: Demi Marie Obenour <demiobenour@gmail.com>
Date:   Fri Aug 12 22:02:02 2022 -0400

    DISPLAY starting with / or unix: is always a socket path
    
    If DISPLAY starts with / or unix:, do not check for anything but a full
    filesystem socket path.  In particular, abstract AF_UNIX sockets and TCP
    sockets will not be used in this case.   Also be stricter about parsing
    the screen part of /path.screen displays, and bail out after all stat()
    errors other than ENOENT.
    
    Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>

commit ccdef1a8a5b6956a3fb7115d634db213433dca75
Author: Demi Marie Obenour <demiobenour@gmail.com>
Date:   Sun Jul 3 17:57:11 2022 -0400

    Allow full paths to sockets on non-macOS
    
    When combined with xorg/lib/libxtrans!7, this allows CVE-2020-25697 to
    be mitigated by placing the AF_UNIX socket in a secure directory on the
    filesystem.
    
    This enables HAVE_LAUNCHD unconditionally and deletes the configure
    switch.
    
    Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>

commit 18e109d755c5ce18157fdabb6de8ee6845b348ff
Author: Matthieu Herrb <matthieu@herrb.eu>
Date:   Tue Feb 28 14:19:21 2023 +0100

    Fix xcb_connect() call with a custom xcb_auth_info_t
    
    If the function implementing xcb_connect is called directly with a
    custom xcb_auth_info_t then checking that the screen in $DISPLAY
    is valid is skipped.
    
    Reported by chohag AT jtan DOT com
    
    Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>

commit fd04ab24a5e99d53874789439d3ffb0eb82574f7
Author: Jan Beich <jbeich@FreeBSD.org>
Date:   Fri Feb 10 14:16:20 2023 +0000

    configure.ac: drop `pthread-stubs` dependency on DragonFly and FreeBSD
    
    All `pthread_*` symbols used by libxcb have stubs in libc. So, stop
    linking against libpthread.

commit 4d1a578dd5348909ade2a853d806272326d228d7
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Thu Feb 9 14:56:38 2023 -0800

    Raise minimum required version of Python from 2.6 to 3.0
    
    Trying to build with Python 2.7.14 fails with:
      File "./c_client.py", line 2270
        key = (*self.name[:-1], field.enum)
               ^
    SyntaxError: invalid syntax
    
    Fixes: 33f3dbe ("Fix handling of documented enum parameters")
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

commit e2a3e80eb837eaaa834a01a2741d4c249c984442
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Mon Feb 6 15:48:49 2023 -0800

    configure.ac: Remove obsolete AC_HEADER_STDC
    
    Nothing checks for the STDC_HEADERS flag this set, and all supported
    systems have C89 compatible headers now.
    
    Clears autoconf warnings of:
    configure.ac:93: warning: The macro `AC_HEADER_STDC' is obsolete.
    configure.ac:93: You should run autoupdate.
    ./lib/autoconf/headers.m4:704: AC_HEADER_STDC is expanded from...
    configure.ac:93: the top level
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

commit 3333d5bde8baaca8981e806ef86b74f4adb77ba7
Author: Daniel G <giri@nwrk.biz>
Date:   Mon Jan 9 16:21:35 2023 +0000

    Fix indentation.

commit 973b510e954f6989ed773f8b357ca50fbc99bced
Author: Daniel G <giri@nwrk.biz>
Date:   Sat Jan 7 19:35:47 2023 +0000

    Fix windows build.

commit cb8c70f5a65b4bd68b449dcaa637c3c4753e2f81
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date:   Sat Nov 26 14:55:07 2022 -0800

    xcb_conn: Add a check for NULL to silence a UBSan runtime error
    
    xcb_conn.c:314:60: runtime error: applying zero offset to null pointer
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>

commit 33f3dbe3699a92e8ca18f470adac456e0b935e75
Author: Demi Marie Obenour <demiobenour@gmail.com>
Date:   Sun Oct 16 01:50:53 2022 -0400

    Fix handling of documented enum parameters
    
    Previously this would crash the code generator.
    
    Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>

commit c9513aac2d78808f63b83d71072c2c483b20162d
Author: Demi Marie Obenour <demi@invisiblethingslab.com>
Date:   Sat Aug 28 12:25:05 2021 -0400

    Fix a compiler warning
    
    The warning is harmless but annoying.
    
    Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>

commit 06e1ef43bbb8c84fc243fa6a53c81147a3a24273
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Tue Oct 4 11:30:09 2022 -0700

    configure.ac: drop dependency `pthread-stubs` on Solaris
    
    On Solaris 10 and later, the pthread functions are directly in libc,
    and libpthread only has metadata to redirect calls from it to the
    libc functions.
    
    On Solaris 9 and older (no longer supported), libc contained its own
    thread stubs that libpthread then overrode.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

commit d53ad60d774176c5b057e2ed4d03a4658ee13690
Author: PaperChalice <lgamma@163.com>
Date:   Sat Aug 13 13:11:10 2022 +0800

    configure.ac: drop dependency `pthread-stubs` on macOS
    
    `libpthread.dylib` on macOS is an alias of `libSystem.B.dylib`,
    every program should link against `libSystem.B.dylib`.

commit e2ee5aabe9f731b7231b0d4a5a21367d1aced6ed
Author: Uli Schlachter <psychon@znc.in>
Date:   Wed Sep 14 14:53:35 2022 +0200

    Improve tutorial example
    
    This tutorial example only handles XCB_EXPOSURE and XCB_KEY_RELEASE
    events and ignores everything else. Thus, there is no point in asking
    for more kinds of events.
    
    A while ago, I ported this tutorial to x11rb [1]. Recently, I received a
    pull request [2] removing these unnecessary event masks. This commit is
    thus only partially by me and the 'issue' was originally found by the
    author of [2].
    
    [1]: https://github.com/psychon/x11rb/blob/master/x11rb/examples/tutorial.rs
    [2]: https://github.com/psychon/x11rb/pull/754
    
    Signed-off-by: Uli Schlachter <psychon@znc.in>

commit 9dcb08170898d3bd5ddb3bc26c514a6bfccf3fae
Author: Mihail Konev <k.mvc@ya.ru>
Date:   Thu Jan 26 13:52:49 2017 +1000

    autogen: add default patch prefix
    
    Signed-off-by: Mihail Konev <k.mvc@ya.ru>
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

commit 7d798d3ccbe537f2f102665447ec3e15a8cdb1a1
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Mon Mar 9 12:00:52 2015 +0000

    autogen.sh: use quoted string variables
    
    Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent
    fall-outs, when they contain space.
    
    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

commit 7071b4a13c1e4df13b138748feebadc17fe2522b
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Jan 24 10:32:07 2017 +1000

    autogen.sh: use exec instead of waiting for configure to finish
    
    Syncs the invocation of configure with the one from the server.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

commit ee60239b7308f98a7a32e2a567681e00c6b652f5
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Mon Jul 18 17:55:43 2022 -0700

    gitlab CI: add a basic build test
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

commit 3123dfe723648c5abeab429e7cb4bd194ceeb8f6
Author: Mike Sharov <msharov@users.sourceforge.net>
Date:   Wed Jun 22 10:56:37 2022 -0400

    Require xcb-proto >= 1.15.1, which has Dbe
    
    Signed-off-by: Mike Sharov <msharov@users.sourceforge.net>

commit 816407655f75cf8ae505432cb743c316e009679d
Author: Mike Sharov <msharov@users.sourceforge.net>
Date:   Thu Jun 2 13:27:48 2022 -0400

    Build DOUBLE-BUFFER extension.
    
    Signed-off-by: Mike Sharov <msharov@users.sourceforge.net>

commit c2c4a2cd1947e559718acdba19ef6e7db731dbeb
Author: Matt Turner <mattst88@gmail.com>
Date:   Tue May 3 15:09:54 2022 -0700

    libxcb 1.15
    
    Signed-off-by: Matt Turner <mattst88@gmail.com>

commit ddafdba11f6919e6fcf977c09c78b06f94de47aa
Author: Hodong <hodong@yozmos.com>
Date:   Sat Jan 15 02:32:04 2022 +0900

    Fix a memory leak
    
    Signed-off-by: Hodong <hodong@yozmos.com>

commit 43fbf03e549bf6da8d1d8522e0ceddc4d49c37c6
Author: Demi Marie Obenour <demiobenour@gmail.com>
Date:   Thu Sep 23 16:46:32 2021 -0400

    Fix integer overflows in xcb_in.c
    
    This fixes an integer overflow security vulnerability in xcb_in.c, which
    may allow for memory corruption.

commit 233d7b7f1f03ef18bf3955eb1f20421e745d22f0
Author: Thomas Anderson <thomasanderson@google.com>
Date:   Wed Dec 2 00:25:42 2020 +0000

    Fix hang in xcb_request_check()
    
    This fixes https://gitlab.freedesktop.org/xorg/lib/libxcb/-/issues/53
    
    The issue was that libxcb expected to get a reply based on the request_expected
    variable, but a reply would never arrive because the request was never actually
    written.  To resolve this, a separate request_expected_written variable is
    added.

commit dc2811874729ee83fa2aef110f60808c450f9a5a
Author: Ran Benita <ran@unusedvar.com>
Date:   Tue Nov 17 23:18:53 2020 +0200

    Avoid request counter truncation in replies map after 2**32 requests
    
    The c->in request counters are uint64_t, and can realistically go over
    2**32 over a lifetime of a client. The c->in->replies map however uses
    unsigned int keys and the passed request numbers are silently truncated.
    
    I haven't analyzed in depth what happens what it wraps around but it's
    probably nothing good.
    
    The only user of the xcb_list.c map code is c->in->replies, so just
    change it to use uint64_t keys.
    
    Reviewed-by: Uli Schlachter <psychon@znc.in>
    Signed-off-by: Ran Benita <ran@unusedvar.com>

commit 26396bf156cfa00ecd655ec6a5f2f46626d674c0
Author: Julien Cristau <jcristau@debian.org>
Date:   Tue Feb 2 12:15:10 2021 +0100

    Add newline when printing auth/connection failure string to stderr
    
    The reason strings returned by the server don't all include a newline,
    so make sure we add one to avoid confusing clients.  Xlib used to do
    this before it delegated that work to libxcb.
    
    Fixes #34
    
    Signed-off-by: Julien Cristau <jcristau@debian.org>

commit a503167f751ba77e6819df568b7f5042d2baa9c9
Author: Uli Schlachter <psychon@znc.in>
Date:   Sat May 22 21:43:22 2021 +0200

    Improve/fix docs for reply fds functions
    
    Fixes: https://gitlab.freedesktop.org/xorg/lib/libxcb/-/issues/56
    Signed-off-by: Uli Schlachter <psychon@znc.in>

commit 3c76c0579ffa521af41f78ee937b1337581da985
Author: Povilas Kanapickas <povilas@radix.lt>
Date:   Fri Jul 30 22:58:47 2021 +0300

    c_client.py: Implement handling of <length> element
    
    Signed-off-by: Povilas Kanapickas <povilas@radix.lt>

commit bdc3f21a5205293852bbaa173f43389cbf66f52b
Author: Povilas Kanapickas <povilas@radix.lt>
Date:   Fri Jul 30 22:58:46 2021 +0300

    c_client: Extract _c_get_field_mapping_for_expr()

commit 068af21cb376eb824fa1dee29a6539feadb93587
Author: Povilas Kanapickas <povilas@radix.lt>
Date:   Fri Jul 30 22:58:45 2021 +0300

    c_client.py: Use get_expr_field_names directly to resolve list fields
    
    Using get_expr_fields() is only needed in case we are doing things that
    can span multiple types easily, e.g. when deciding what data to pass via
    function parameters and so on.
    
    In _c_serialize_helper_list_field() we are building function body, so
    acquiring field names via get_expr_field_names() is enough.
    
    Signed-off-by: Povilas Kanapickas <povilas@radix.lt>

commit 4d678b162bf8a3b10e5bdf76df2be63d33c23381
Author: Povilas Kanapickas <povilas@radix.lt>
Date:   Fri Jul 30 22:58:44 2021 +0300

    c_client.py: Extract get_expr_field_names()
    
    Signed-off-by: Povilas Kanapickas <povilas@radix.lt>

commit 21414e7c447f18224c577ed5e32bd5d6e45c44f9
Author: Peter Harris <pharris@opentext.com>
Date:   Mon Feb 1 19:45:28 2021 -0500

    Fix writev emulation on Windows
    
    There are at least two bugs in the previous implementation:
    
    - If an early iovec is partially written, there can be a gap of missing
      data (as a later iovec will be started before the early iovec is
      completed).
    - If a late iovec returns WSAEWOULDBLOCK, *vector and *count are not
      updated, leading to a re-send of the entire request.
    
    Move the *vector update into the send() loop to update piecemeal as
    individual iovecs are sent.
    
    Example program that demonstrates the issue (this program should run
    forever after these bugs have been fixed):
    
    #include <stdio.h>
    #include <stdlib.h>
    #include "xcb.h"
    
    // Non-cryptographic random number generator from http://burtleburtle.net/bob/rand/smallprng.html
    // because Microsoft's random number generators either have a too small RAND_MAX or are too slow
    typedef struct ranctx { uint32_t a; uint32_t b; uint32_t c; uint32_t d; } ranctx;
    
    static uint32_t ranval(ranctx *x);
    static void raninit(ranctx *x, uint32_t seed);
    
    
    #define MAX_PROP_LEN (128 * 1024)
    
    int main(int argc, char *argv[]) {
        uint32_t seed = 0x12345678;
        if (argc > 1) {
            seed = strtoul(argv[1], NULL, 0);
        }
        ranctx ran;
        raninit(&ran, seed);
    
        xcb_connection_t *c = xcb_connect(NULL, NULL);
        if (!c || xcb_connection_has_error(c)) {
            printf("Cannot connect to $DISPLAY\n");
            return 1;
        }
        const xcb_setup_t *setup = xcb_get_setup(c);
        char *buf = malloc(MAX_PROP_LEN + 8); // plus a bit of slack so we can run random values off the end
        if (!buf) {
            printf("oom\n");
            return 1;
        }
        for (uint32_t i=0; i < (MAX_PROP_LEN + 3) / 4; i++) {
            ((uint32_t *)buf)[i] = ranval(&ran);
        }
    
        xcb_window_t win = xcb_generate_id(c);
        xcb_create_window(c, 0, win, xcb_setup_roots_iterator(setup).data[0].root, 0, 0, 1, 1, 0,
                XCB_WINDOW_CLASS_INPUT_ONLY, 0, 0, NULL);
        printf("Created window 0x%X\n", win);
    
        for (;;) {
            xcb_flush(c);
            xcb_generic_event_t *ev = xcb_poll_for_event(c);
            if (ev) {
                if (ev->response_type == 0) {
                    xcb_generic_error_t *err = (xcb_generic_error_t *)ev;
                    printf("Unexpected X Error %d\n", err->error_code);
                    printf("   Sequence %d\n", err->sequence);
                    printf("   Resource ID 0x%X\n", err->resource_id);
                    printf("   Opcode: %d.%d\n", err->major_code, err->minor_code);
                    return 1;
                }
                printf("Unexpected X Event %d\n", ev->response_type);
                return 1;
            }
    
            uint32_t siz = ranval(&ran) % MAX_PROP_LEN + 1;
            xcb_change_property(c, XCB_PROP_MODE_REPLACE, win, XCB_ATOM_STRING, XCB_ATOM_STRING, 8, siz, buf);
        }
    
        return 0;
    }
    
    
    #define rot(x,k) (((x)<<(k))|((x)>>(32-(k))))
    static uint32_t ranval(ranctx *x) {
        uint32_t e = x->a - rot(x->b, 27);
        x->a = x->b ^ rot(x->c, 17);
        x->b = x->c + x->d;
        x->c = x->d + e;
        x->d = e + x->a;
        return x->d;
    }
    
    static void raninit(ranctx *x, uint32_t seed) {
        uint32_t i;
        x->a = 0xf1ea5eed, x->b = x->c = x->d = seed;
        for (i = 0; i<20; ++i) {
            (void)ranval(x);
        }
    }
    
    Signed-off-by: Peter Harris <pharris@opentext.com>

commit 4b0d9d3868aad8d5f4266821e9eda586e6c2bfa7
Author: Peter Harris <pharris@opentext.com>
Date:   Mon Feb 1 17:43:52 2021 -0500

    Fix build on Windows
    
    Notable changes: Protect include of unistd.h (and other POSIX headers).
    Use SOCKET (which is larger than int) and closesocket (because close is
    not compatible) for sockets. Use <stdint.h>'s intptr_t instead of the
    non-portable ssize_t.
    
    Signed-off-by: Peter Harris <pharris@opentext.com>

commit cd0fba98a2d0867d505ff1a7ca8d7a7c757acfa2
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Tue Jun 1 18:36:17 2021 -0700

    xcb_auth: Quiet -Wimplicit-fallthrough warning in get_authptr()
    
    xcb_auth.c:135:14: warning: this statement may fall through [-Wimplicit-fallthrough=]
             addr += 12;
             ~~~~~^~~~~
    xcb_auth.c:138:5: note: here
         case AF_INET:
         ^~~~
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

commit 2ef8655987b9862cdddb72223c9f259a860d5777
Author: Julien Cristau <jcristau@debian.org>
Date:   Mon Feb 1 19:23:02 2021 +0100

    Increment libtool version info for libxcb-dri3
    
    Somewhat belatedly given the last update was in xcb-proto 1.13 in 2017...
    
    Quoting @smcv from https://bugs.debian.org/921069:
    >>>
    libxcb-dri3 version 1.13 appears to have added new symbols without increasing
    the minor ABI version in its -version-info. This will break anything that
    compares libraries by their version info to decide which one is newer.
    
    The Steam Runtime uses libraries' major/minor/micro ABI version info (in this
    case 0.0.0) to decide whether to use the system copy of a library or the copy
    in the Steam Runtime, depending on which one is newer (#921026). We can
    work around this by adding a versioned dependency on libxcb-dri3-0 and
    deleting the copy from the Steam Runtime, but this isn't a particularly
    scalable solution.
    >>>

commit 4cbcac4eca967abfbff7cf1ea473777c5e8c375c
Author: Ran Benita <ran@unusedvar.com>
Date:   Tue Nov 17 23:45:14 2020 +0200

    gitignore: add files generated by make check
    
    Signed-off-by: Ran Benita <ran@unusedvar.com>

commit f01f3c378eb0168fbb055c7be1c2d08a7acd3752
Author: Ran Benita <ran@unusedvar.com>
Date:   Tue Nov 17 23:43:06 2020 +0200

    tests: don't use deprecated fail_unless check API
    
    It causes errors like this when running make check:
    
    check_public.c:40:24: error: too many arguments for format [-Werror=format-extra-args]
       40 |   fail_unless(success, "unexpected parse failure %sfor '%s'", test_string[test_type], name);
    
    Closes: https://gitlab.freedesktop.org/xorg/lib/libxcb/-/issues/49
    Tested-by: Matt Turner <mattst88@gmail.com>
    Signed-off-by: Ran Benita <ran@unusedvar.com>

commit 704e0a91b1dece9a4cce7cfe8beaeb86a5e14267
Author: Eduardo Sánchez Muñoz <esm@eduardosm.net>
Date:   Mon Mar 2 18:59:45 2020 +0100

    Use the 'present' field to properly check that the XC-MISC
    extension is available in xcb_generate_id.
    
    Also document the returned value when xcb_generate_id fails.

commit 4b40b44cb6d088b6ffa2fb5cf3ad8f12da588cef
Author: Matt Turner <mattst88@gmail.com>
Date:   Sat Feb 22 12:10:53 2020 -0800

    Release libxcb 1.14
    
    Signed-off-by: Matt Turner <mattst88@gmail.com>

commit 78c492deaa7ae3aad0b0eeb4b126bb291cc637a7
Author: Matt Turner <mattst88@gmail.com>
Date:   Sat Feb 22 12:19:58 2020 -0800

    Build xz tarballs instead of bzip2
    
    Signed-off-by: Matt Turner <mattst88@gmail.com>

commit 8f7e4c4e9fc6ee6b5b5498a7d8af79150be0d26a
Author: Matt Turner <mattst88@gmail.com>
Date:   Sat Feb 22 11:24:11 2020 -0800

    configure.ac: Depend on pthread-stubs only on not-Linux
    
    Signed-off-by: Matt Turner <mattst88@gmail.com>

commit f9f4b00aad69ff36e81c63089b1b16660eaca900
Author: Sam Varshavchik <mrsam@courier-mta.com>
Date:   Sat Jan 4 10:43:59 2020 -0500

    Implement xcb_total_read() and xcb_total_written().
    
    Returns raw byte counts that have been read or written to the
    xcb_connection_t.
    
    I found it very useful when developing a high level widget toolkit, to
    track down inefficient/sub-optimum code that generates a lot of X
    protocol traffic.
    
    Signed-off-by: Sam Varshavchik <mrsam@courier-mta.com>

commit 59e271e15bcecf0c461cd5c6c59081fb86b96c22
Author: A. Wilcox <AWilcox@Wilcox-Tech.com>
Date:   Mon Dec 23 21:49:29 2019 -0600

    tests: Support Check 0.13.0 API
    
    [mattst88]: Keep compatibility  with old API via preprocessor
    
    Fixes: #43

commit 21324989b7e121c008a2c4fdf98547541cbf7b83
Author: Martin Dørum <martid0311@gmail.com>
Date:   Sun May 19 16:05:08 2019 +0200

    Handle EINTR from recvmsg in _xcb_in_read
    
    I have a GTK application which occasionally crashes with an "interrupted
    system call" g_message from gdk. After a lot of debugging, I've found
    that the call to recvmsg in _xcb_in_read occasionally fails with EINTR,
    and instead of retrying the system call, xcb would just shut down the
    connection.
    
    This change makes _xcb_in_read treat EINTR the same as it would treat
    EAGAIN; it returns 1 and libX11 ends up calling xcb_poll_for_event
    again (from what I have understood).
    
    I have spoken with a few people who think recvmsg failing with EINTR in
    this case shouldn't ever happen, and I don't know enough to agree or
    disagree with that. In case anyone wants to dig further and try to
    figure out why the recvmsg call sometimes fails with EINTR, here's the
    backtrace from inside of _xcb_in_read where that happened:
    
    Thread 1 "beanbar" hit Breakpoint 1, _xcb_in_read (c=c@entry=0x55ecbe4aba80) at xcb_in.c:1059
    1059                fprintf(stderr, "Hello World am %s:%i, errno is %s\n", __FILE__, __LINE__, strerror(errno));
    (gdb) bt
    0  0x00007fa48fa48639 in _xcb_in_read (c=c@entry=0x55ecbe4aba80) at xcb_in.c:1059
    1  0x00007fa48fa489d8 in poll_for_next_event (c=0x55ecbe4aba80, queued=queued@entry=0) at xcb_in.c:352
    2  0x00007fa48fa48a3d in poll_for_next_event (queued=0, c=<optimized out>) at xcb_in.c:722
    3  0x00007fa48fa48a3d in xcb_poll_for_event (c=<optimized out>) at xcb_in.c:722
    4  0x00007fa4908d1b7e in poll_for_event (dpy=dpy@entry=0x55ecbe4a9730, queued_only=queued_only@entry=0) at xcb_io.c:245
    5  0x00007fa4908d1cf0 in poll_for_response (dpy=dpy@entry=0x55ecbe4a9730) at xcb_io.c:303
    6  0x00007fa4908d1fed in _XEventsQueued (mode=2, dpy=0x55ecbe4a9730) at xcb_io.c:363
    7  0x00007fa4908d1fed in _XEventsQueued (dpy=dpy@entry=0x55ecbe4a9730, mode=mode@entry=2) at xcb_io.c:344
    8  0x00007fa4908c3d47 in XPending (dpy=0x55ecbe4a9730) at Pending.c:55
    9  0x00007fa493cadbc7 in  () at /usr/lib/libgdk-3.so.0
    10 0x00007fa49234d08a in g_main_context_prepare () at /usr/lib/libglib-2.0.so.0
    11 0x00007fa49234d6e6 in  () at /usr/lib/libglib-2.0.so.0
    12 0x00007fa49234d8ae in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
    13 0x00007fa4938b920e in g_application_run () at /usr/lib/libgio-2.0.so.0
    14 0x000055ecbc820af4 in main (argc=1, argv=0x7ffd06238098) at src/main.c:190
    
    Signed-off-by: Martin Dørum <martid0311@gmail.com>

commit 656c08c5429a3cf53e7abd7fc56cd3c3a79c0f64
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Sun Sep 14 00:05:27 2014 +0100

    Include time.h before using time()
    
    Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>

commit be1745c8eb00defcb31d336ccc142de056e92bd8
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Sun Feb 17 12:06:10 2019 -0800

    Add README.md to EXTRA_DIST
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

commit 58f37377c851960cbf21fac1caf38ab1e66c7d6c
Author: Eduardo Sánchez Muñoz <esm@eduardosm.net>
Date:   Sun Feb 17 13:33:12 2019 +0100

    Add "ge.*" to src/.gitignore

commit 7bac366953005233fc3c8736e6f1cd5798e65e28
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Sat Feb 16 13:41:28 2019 -0800

    Update README for gitlab migration
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

commit 02ff3eadf48e6affe3b59ef688312b4dab538e8b
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Sat Feb 16 13:20:45 2019 -0800

    Update configure.ac bug URL for gitlab migration
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

commit 542befe40a3a7c6a5d1dcb7f38fb9eb261b96b24
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Mon Jan 7 14:42:53 2019 -0800

    c_client: fix "adress" typo
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

commit 8287ebd7b752c33b0cabc4982606fe4831106f7e
Author: Uli Schlachter <psychon@znc.in>
Date:   Thu Sep 27 14:04:17 2018 +0200

    Release libxcb 1.13.1

commit bbda345a718ff73086437e51f03fcbb73e4365b9
Author: Erik Kurzinger <ekurzinger@nvidia.com>
Date:   Mon Aug 20 12:06:25 2018 -0700

    don't flag extra reply in xcb_take_socket
    
    If any flags are specified in a call to xcb_take_socket,
    they should only be applied to replies for requests sent
    after that function returns (and until the socket is
    re-acquired by XCB).
    
    Previously, they would also be incorrectly applied to the
    reply for the last request sent before the socket was taken.
    For instance, in this example program the reply for the
    GetInputFocus request gets discarded, even though it was
    sent before the socket was taken. This results in the
    call to retrieve the reply hanging indefinitely.
    
    static void return_socket(void *closure) {}
    
    int main(void)
    {
        Display *dpy = XOpenDisplay(NULL);
        xcb_connection_t *c = XGetXCBConnection(dpy);
    
        xcb_get_input_focus_cookie_t cookie = xcb_get_input_focus_unchecked(c);
        xcb_flush(c);
    
        uint64_t seq;
        xcb_take_socket(c, return_socket, dpy, XCB_REQUEST_DISCARD_REPLY, &seq);
    
        xcb_generic_error_t *err;
        xcb_get_input_focus_reply(c, cookie, &err);
    }
    
    In practice, this has been causing intermittent KWin crashes when
    used in combination with the proprietary NVIDIA driver such as
    https://bugs.kde.org/show_bug.cgi?id=386370 since when Xlib fails to
    retrieve one of these incorrectly discarded replies it triggers
    an IO error.
    
    Signed-off-by: Erik Kurzinger <ekurzinger@nvidia.com>
    Signed-off-by: Uli Schlachter <psychon@znc.in>

commit 7e0f166579672d71efd819c81f0c932b0acd542c
Author: Daniel Stone <daniels@collabora.com>
Date:   Wed Feb 28 01:26:55 2018 +0000

    Release libxcb 1.13
    
    Signed-off-by: Daniel Stone <daniels@collabora.com>

commit a3e9821bec08a69b355b46b0655562b9df61bb21
Author: Daniel Stone <daniels@collabora.com>
Date:   Wed Apr 26 17:55:54 2017 +0200

    c_client: Add support for lists of FDs
    
    Matching xcbgen changes, add support having a ListType which contains
    file descriptors. Use this to send a variable number of FDs to the
    server, including when the list size is not fixed.
    
    Signed-off-by: Daniel Stone <daniels@collabora.com>

commit c7aa4e682fdc7f0035f928af6eafd052e38cc15a
Author: Daniel Stone <daniels@collabora.com>
Date:   Wed Apr 26 17:54:01 2017 +0200

    c_client: Don't serialise non-wire fields
    
    For when we have a variable-sized field followed by a fixed field, make
    sure we do not serialise non-wire fields.
    
    Signed-off-by: Daniel Stone <daniels@collabora.com>

commit d10194a321c3db851b3ede9a98cdc95e951943aa
Author: Christian Linhart <chris@demorecorder.com>
Date:   Sat Mar 11 22:03:34 2017 +0100

    enable xinput by default
    
    Support for the xinput extension is complete now,
    as far as I can tell.
    
    According to our discussion on the list, we enable it now.
    
    Signed-off-by: Christian Linhart <chris@demorecorder.com>

commit fad81b63422105f9345215ab2716c4b804ec7986
Author: David McFarland <corngood@gmail.com>
Date:   Tue Apr 18 23:58:59 2017 -0300

    read from connection when polling special events and replies
    
    Using the mesa vulkan driver, if you acquire an image from a
    swapchain using a finite timeout (x11_acquire_next_image_poll_x11),
    it will occasionally lock, calling xcb_poll_for_special_event in
    a loop until the timeout expires.
    
    Call _xcb_in_read() once from the polling functions for special
    events and replies, in the same way as xcb_poll_for_event.
    
    Signed-off-by: David McFarland <corngood@gmail.com>
    Signed-off-by: Uli Schlachter <psychon@znc.in>

commit f830eb93c9c38b2c6c7ea2971af3bc6a61e92277
Author: Tobias Stoeckmann <tobias@stoeckmann.org>
Date:   Sun Mar 26 15:41:12 2017 +0200

    Check strdup for NULL return value.
[--snip--]
