|
|
1.1 ! root 1: #include "copyright.h" ! 2: ! 3: /* $Header: XSync.c,v 11.12 87/09/11 08:07:42 toddb Exp $ */ ! 4: /* Copyright Massachusetts Institute of Technology 1986 */ ! 5: ! 6: #define NEED_REPLIES ! 7: #define NEED_EVENTS ! 8: #include "Xlibint.h" ! 9: ! 10: extern _XQEvent *_qfree; ! 11: ! 12: /* Synchronize with errors and events, optionally discarding pending events */ ! 13: ! 14: XSync (dpy, discard) ! 15: register Display *dpy; ! 16: int discard; ! 17: { ! 18: xGetInputFocusReply rep; ! 19: register xReq *req; ! 20: ! 21: LockDisplay(dpy); ! 22: GetEmptyReq(GetInputFocus, req); ! 23: (void) _XReply (dpy, (xReply *)&rep, 0, xTrue); ! 24: ! 25: if (discard && dpy->head) { ! 26: ((_XQEvent *)dpy->tail)->next = _qfree; ! 27: _qfree = (_XQEvent *)dpy->head; ! 28: dpy->head = dpy->tail = NULL; ! 29: dpy->qlen = 0; ! 30: } ! 31: UnlockDisplay(dpy); ! 32: } ! 33:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.