aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-06-25 00:17:10 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-06-25 00:17:10 +0200
commit9c1275f58b5e19f5495a83ef84afb023991b49d9 (patch)
tree5e596ec83c786375bab97b0695cd7cf124b0bd66 /nx-X11/lib
parent17f3e3bc5157eeb6018ddaa6d862ca94f4b02b2b (diff)
parent5ee04c24c5b7cafc7ed01ae586b5910be73271ff (diff)
downloadnx-libs-9c1275f58b5e19f5495a83ef84afb023991b49d9.tar.gz
nx-libs-9c1275f58b5e19f5495a83ef84afb023991b49d9.tar.bz2
nx-libs-9c1275f58b5e19f5495a83ef84afb023991b49d9.zip
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
Diffstat (limited to 'nx-X11/lib')
-rw-r--r--nx-X11/lib/X11/IfEvent.c1
-rw-r--r--nx-X11/lib/X11/MaskEvent.c1
-rw-r--r--nx-X11/lib/X11/NextEvent.c6
-rw-r--r--nx-X11/lib/X11/PeekEvent.c6
-rw-r--r--nx-X11/lib/X11/PeekIfEv.c1
-rw-r--r--nx-X11/lib/X11/WinEvent.c6
6 files changed, 21 insertions, 0 deletions
diff --git a/nx-X11/lib/X11/IfEvent.c b/nx-X11/lib/X11/IfEvent.c
index a7c0cb188..9cf07f56d 100644
--- a/nx-X11/lib/X11/IfEvent.c
+++ b/nx-X11/lib/X11/IfEvent.c
@@ -73,6 +73,7 @@ XIfEvent (dpy, event, predicate, arg)
prev = NULL;
#ifdef NX_TRANS_SOCKET
if (_XGetIOError(dpy)) {
+ UnlockDisplay(dpy);
return 0;
}
#endif
diff --git a/nx-X11/lib/X11/MaskEvent.c b/nx-X11/lib/X11/MaskEvent.c
index c48a960d2..a46766685 100644
--- a/nx-X11/lib/X11/MaskEvent.c
+++ b/nx-X11/lib/X11/MaskEvent.c
@@ -77,6 +77,7 @@ XMaskEvent (dpy, mask, event)
prev = NULL;
#ifdef NX_TRANS_SOCKET
if (_XGetIOError(dpy)) {
+ UnlockDisplay(dpy);
return 0;
}
#endif
diff --git a/nx-X11/lib/X11/NextEvent.c b/nx-X11/lib/X11/NextEvent.c
index 1c9080651..71d84223e 100644
--- a/nx-X11/lib/X11/NextEvent.c
+++ b/nx-X11/lib/X11/NextEvent.c
@@ -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);
diff --git a/nx-X11/lib/X11/PeekEvent.c b/nx-X11/lib/X11/PeekEvent.c
index b89c6c95e..b8d755f0a 100644
--- a/nx-X11/lib/X11/PeekEvent.c
+++ b/nx-X11/lib/X11/PeekEvent.c
@@ -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;
diff --git a/nx-X11/lib/X11/PeekIfEv.c b/nx-X11/lib/X11/PeekIfEv.c
index a8da27932..93a725b49 100644
--- a/nx-X11/lib/X11/PeekIfEv.c
+++ b/nx-X11/lib/X11/PeekIfEv.c
@@ -73,6 +73,7 @@ XPeekIfEvent (dpy, event, predicate, arg)
prev = NULL;
#ifdef NX_TRANS_SOCKET
if (_XGetIOError(dpy)) {
+ UnlockDisplay(dpy);
return 0;
}
#endif
diff --git a/nx-X11/lib/X11/WinEvent.c b/nx-X11/lib/X11/WinEvent.c
index 67e825cb5..961fcf74b 100644
--- a/nx-X11/lib/X11/WinEvent.c
+++ b/nx-X11/lib/X11/WinEvent.c
@@ -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
}
}