event: restore event sequence number after passing it to Xlib handlers

We set event sequence number to the last sequence xlib knows about to
silence its complaint about missing sequence numbers, but we forgot to
restore it back afterwards.

This used to break error ignoring mechanism in `should_ignore`. In the
last commit we updated it to use full_sequence which incidently fixed
this problem. But let's restore the sequence number anyway for good
measure.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2022-12-14 13:35:11 +00:00
committed by Arda Atci
parent eec8bf79d2
commit c51020aef7

View File

@@ -121,11 +121,13 @@ static inline const char *ev_name(session_t *ps, xcb_generic_event_t *ev) {
CASESTRRET(ClientMessage);
}
if (ps->damage_event + XCB_DAMAGE_NOTIFY == ev->response_type)
if (ps->damage_event + XCB_DAMAGE_NOTIFY == ev->response_type) {
return "Damage";
}
if (ps->shape_exists && ev->response_type == ps->shape_event)
if (ps->shape_exists && ev->response_type == ps->shape_event) {
return "ShapeNotify";
}
if (ps->xsync_exists) {
int o = ev->response_type - ps->xsync_event;
@@ -704,8 +706,11 @@ void ev_handle(session_t *ps, xcb_generic_event_t *ev) {
// missing sequence numbers.
//
// We only need the low 16 bits
uint16_t seq = ev->sequence;
ev->sequence = (uint16_t)(LastKnownRequestProcessed(ps->dpy) & 0xffff);
proc(ps->dpy, &dummy, (xEvent *)ev);
// Restore the sequence number
ev->sequence = seq;
}
// XXX redraw needs to be more fine grained