Skip to content

Commit 5a5ea76

Browse files
committed
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>
1 parent 8b189bc commit 5a5ea76

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/event.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,13 @@ static inline const char *ev_name(session_t *ps, xcb_generic_event_t *ev) {
121121
CASESTRRET(ClientMessage);
122122
}
123123

124-
if (ps->damage_event + XCB_DAMAGE_NOTIFY == ev->response_type)
124+
if (ps->damage_event + XCB_DAMAGE_NOTIFY == ev->response_type) {
125125
return "Damage";
126+
}
126127

127-
if (ps->shape_exists && ev->response_type == ps->shape_event)
128+
if (ps->shape_exists && ev->response_type == ps->shape_event) {
128129
return "ShapeNotify";
130+
}
129131

130132
if (ps->xsync_exists) {
131133
int o = ev->response_type - ps->xsync_event;
@@ -695,8 +697,11 @@ void ev_handle(session_t *ps, xcb_generic_event_t *ev) {
695697
// missing sequence numbers.
696698
//
697699
// We only need the low 16 bits
700+
uint16_t seq = ev->sequence;
698701
ev->sequence = (uint16_t)(LastKnownRequestProcessed(ps->dpy) & 0xffff);
699702
proc(ps->dpy, &dummy, (xEvent *)ev);
703+
// Restore the sequence number
704+
ev->sequence = seq;
700705
}
701706

702707
// XXX redraw needs to be more fine grained

0 commit comments

Comments
 (0)