Unverified Commit 9c1275f5 authored by Mike Gabriel's avatar Mike Gabriel

Merge branch 'uli42-pr/fix-crash-in-XPeekEvent' into 3.6.x

Attributes GH PR #154: https://github.com/ArcticaProject/nx-libs/pull/154 arting with '#' will be ignored, and an empty message aborts
parents 17f3e3bc 5ee04c24
......@@ -73,6 +73,7 @@ XIfEvent (dpy, event, predicate, arg)
prev = NULL;
#ifdef NX_TRANS_SOCKET
if (_XGetIOError(dpy)) {
UnlockDisplay(dpy);
return 0;
}
#endif
......
......@@ -77,6 +77,7 @@ XMaskEvent (dpy, mask, event)
prev = NULL;
#ifdef NX_TRANS_SOCKET
if (_XGetIOError(dpy)) {
UnlockDisplay(dpy);
return 0;
}
#endif
......
......@@ -48,6 +48,12 @@ XNextEvent (dpy, event)
if (dpy->head == NULL)
_XReadEvents(dpy);
#ifdef NX_TRANS_SOCKET
if (_XGetIOError(dpy)) {
UnlockDisplay(dpy);
return 0;
}
#endif
qelt = dpy->head;
*event = qelt->event;
_XDeq(dpy, NULL, qelt);
......
......@@ -46,6 +46,12 @@ XPeekEvent (dpy, event)
LockDisplay(dpy);
if (dpy->head == NULL)
_XReadEvents(dpy);
#ifdef NX_TRANS_SOCKET
if (_XGetIOError(dpy)) {
UnlockDisplay(dpy);
return 1;
}
#endif
*event = (dpy->head)->event;
UnlockDisplay(dpy);
return 1;
......
......@@ -73,6 +73,7 @@ XPeekIfEvent (dpy, event, predicate, arg)
prev = NULL;
#ifdef NX_TRANS_SOCKET
if (_XGetIOError(dpy)) {
UnlockDisplay(dpy);
return 0;
}
#endif
......
......@@ -79,5 +79,11 @@ XWindowEvent (dpy, w, mask, event)
if (prev && prev->qserial_num != qe_serial)
/* another thread has snatched this event */
prev = NULL;
#ifdef NX_TRANS_SOCKET
if (_XGetIOError(dpy)) {
UnlockDisplay(dpy);
return 0;
}
#endif
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment