core: added proper event handling for XESetWireToEvent

This commit is contained in:
Nikolay Borodin 2023-06-16 23:50:20 +02:00
parent cee1287562
commit 07303ce2cb
2 changed files with 5 additions and 2 deletions

View File

@ -7,6 +7,7 @@
#include <X11/extensions/sync.h>
#include <xcb/damage.h>
#include <xcb/randr.h>
#include <xcb/xcb_event.h>
#include "atom.h"
#include "common.h"
@ -687,9 +688,9 @@ void ev_handle(session_t *ps, xcb_generic_event_t *ev) {
// For even more details, see:
// https://bugs.freedesktop.org/show_bug.cgi?id=35945
// https://lists.freedesktop.org/archives/xcb/2011-November/007337.html
auto proc = XESetWireToEvent(ps->dpy, ev->response_type, 0);
auto proc = XESetWireToEvent(ps->dpy, XCB_EVENT_RESPONSE_TYPE(ev), 0);
if (proc) {
XESetWireToEvent(ps->dpy, ev->response_type, proc);
XESetWireToEvent(ps->dpy, XCB_EVENT_RESPONSE_TYPE(ev), proc);
XEvent dummy;
// Stop Xlib from complaining about lost sequence numbers.

View File

@ -31,6 +31,8 @@ foreach i : required_xcb_packages
base_deps += [dependency(i, version: '>=1.12.0', required: true)]
endforeach
base_deps += [dependency('xcb-util', version: '>=0.4.0', required: true)]
if not cc.has_header('uthash.h')
error('Dependency uthash not found')
endif