summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuxuan Shui <yshuiv7@gmail.com>2023-01-03 15:09:28 +0000
committerYuxuan Shui <yshuiv7@gmail.com>2023-01-03 15:23:07 +0000
commit88399e01be679bfcc9a5e8922ffe2c47f0e56dee (patch)
treeb6dc9d14789a9f8f6fe9a77f4f8e3eb24766d1c4
parent48487c4b9028e9eec5371742f51e1d64c2e17296 (diff)
Revert "Update XPutBackEvent() to support clients that put back unpadded events"
This reverts commit d6d6cba90215d323567fef13d6565756c9956f60. The reverted commit intended to fix the problem where an unpadded X event struct is passed into XPutBackEvent, by creating a padded struct with _XEventToWire and _XWireToEvent. However, _XWireToEvent updates the last sequence number in Display, which may cause xlib to complain about lost sequence numbers. IMO, the problem that commit tried to solve is a bug in the client library, and workaround it inside Xlib is bad practice, especially given the problem it caused. Plus, the offender cited in the original commit message, freeglut, has already fixed this problem. Fixes: #176 #174 Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
-rw-r--r--src/PutBEvent.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/PutBEvent.c b/src/PutBEvent.c
index f7b74b31..0f9df342 100644
--- a/src/PutBEvent.c
+++ b/src/PutBEvent.c
@@ -79,22 +79,9 @@ XPutBackEvent (
register XEvent *event)
{
int ret;
- xEvent wire = {0};
- XEvent lib = {0};
- Status (*fp)(Display *, XEvent *, xEvent *);
- int type = event->type & 0177;
LockDisplay(dpy);
- fp = dpy->wire_vec[type];
- if (fp == NULL)
- fp = _XEventToWire;
- ret = (*fp)(dpy, event, &wire);
- if (ret)
- {
- ret = (*dpy->event_vec[type])(dpy, &lib, &wire);
- if (ret)
- ret = _XPutBackEvent(dpy, &lib);
- }
+ ret = _XPutBackEvent(dpy, event);
UnlockDisplay(dpy);
return ret;
}