From 5930731421ae76931301302c515d75001b9f72a0 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Tue, 26 Jul 2016 00:34:34 +0200 Subject: update all files with NX relevant changes to libX11 1.3.4 --- nx-X11/lib/X11/PeekEvent.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'nx-X11/lib/X11/PeekEvent.c') diff --git a/nx-X11/lib/X11/PeekEvent.c b/nx-X11/lib/X11/PeekEvent.c index 218c9a6dd..ffbaa05b4 100644 --- a/nx-X11/lib/X11/PeekEvent.c +++ b/nx-X11/lib/X11/PeekEvent.c @@ -29,17 +29,18 @@ in this Software without prior written authorization from The Open Group. #endif #include "Xlibint.h" -/* +/* * Return the next event in the queue, * BUT do not remove it from the queue. * If none found, flush and wait until there is an event to peek. */ int -XPeekEvent (dpy, event) - register Display *dpy; - register XEvent *event; +XPeekEvent ( + register Display *dpy, + register XEvent *event) { + XEvent copy; LockDisplay(dpy); if (dpy->head == NULL) _XReadEvents(dpy); @@ -47,9 +48,13 @@ XPeekEvent (dpy, event) if (_XGetIOError(dpy)) { UnlockDisplay(dpy); return 1; - } + } #endif *event = (dpy->head)->event; + if (_XCopyEventCookie(dpy, &event->xcookie, ©.xcookie)) { + _XStoreEventCookie(dpy, ©); + *event = copy; + } UnlockDisplay(dpy); return 1; } -- cgit v1.2.3