|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T X
Length: 1064 (0x428)
Types: TextFile
Names: »XUpdateMouse.c«
└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
└─⟦526ad3590⟧ »EUUGD11/gnu-31mar87/X.V10.R4.tar.Z«
└─⟦2109abc41⟧
└─⟦this⟧ »./X.V10R4/Xlib/XUpdateMouse.c«
#include <X/mit-copyright.h>
/* $Header: XUpdateMouse.c,v 10.4 86/02/01 15:41:37 tony Rel $ */
/* Copyright Massachusetts Institute of Technology 1985 */
#include "XlibInternal.h"
extern _QEvent *_qfree;
/* Like XQueryMouse, but also reads pending events and flushes any MouseMoved
* events at the head of the queue. A good way to track the mouse is to use
* a MouseMoved event as a "hint", by calling this routine to get up to date
* coordinates.
*/
Status XUpdateMouse (w, x, y, subw)
Window w;
Window *subw;
int *x, *y;
{
register Display *dpy;
register XReq *req;
register _QEvent *qelt;
XRep rep;
XPending(dpy = _XlibCurrentDisplay);
/* read all events in socket's kernel buffer */
GetReq(X_QueryMouse, w);
if (!_XReply(dpy, &rep))
return(0);
while ((qelt = dpy->head) && qelt->event.type == MouseMoved) {
if ((dpy->head = qelt->next) == NULL)
dpy->tail = NULL;
qelt->next = _qfree;
_qfree = qelt;
dpy->qlen--;
}
*x = rep.param.s[2];
*y = rep.param.s[3];
*subw = rep.param.l[0];
return (1);
}