summaryrefslogtreecommitdiff
path: root/mi/mipointer.c
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@freedesktop.org>2009-01-11 01:56:45 -0800
committerJeremy Huddleston <jeremyhu@freedesktop.org>2009-01-11 01:56:45 -0800
commit5339c22a8ca8bce6cd2b51e97c904292e7c40e74 (patch)
tree591d4eb4bc541f6f7fa594e2f07332e58617d8f4 /mi/mipointer.c
parent1beff89810cd193e45d437846929b3938cee6d96 (diff)
XQuartz: Add locking to make mieq thread safe on OSX
(cherry picked from commit 7a8d2266861e74176b5310b83652a9c10a170494)
Diffstat (limited to 'mi/mipointer.c')
-rw-r--r--mi/mipointer.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/mi/mipointer.c b/mi/mipointer.c
index 4358759cc..83a355ea3 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -547,6 +547,12 @@ miPointerGetPosition(DeviceIntPtr pDev, int *x, int *y)
*y = MIPOINTER(pDev)->y;
}
+#ifdef XQUARTZ
+#include <pthread.h>
+void darwinEvents_lock(void);
+void darwinEvents_unlock(void);
+#endif
+
void
miPointerMove (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
{
@@ -573,7 +579,13 @@ miPointerMove (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
nevents = GetPointerEvents(events, pDev, MotionNotify, 0, POINTER_ABSOLUTE, 0, 2, valuators);
OsBlockSignals();
+#ifdef XQUARTZ
+ darwinEvents_lock();
+#endif
for (i = 0; i < nevents; i++)
mieqEnqueue(pDev, events[i].event);
+#ifdef XQUARTZ
+ darwinEvents_unlock();
+#endif
OsReleaseSignals();
}