summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2011-09-19 19:32:15 -0700
committerJeremy Huddleston <jeremyhu@apple.com>2011-09-19 19:32:15 -0700
commit2bf78c42ddd0cf0efc297b3455aec4420632b988 (patch)
tree32676e5543e0ad74abd07d55eff512031d8d5b81
parent311488bc0ace95f1c4b6df73a59417109ba68b5f (diff)
Drop input events until our device is initialized
The use of TimerSet() to initialize input is racey, this avoids a crash if initialization looses the race. This is a good workaround for now, but we should look into a better way to initialize when we get a chance later. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r--src/xlibclient.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/xlibclient.c b/src/xlibclient.c
index c1e21ad..1eff59d 100644
--- a/src/xlibclient.c
+++ b/src/xlibclient.c
@@ -297,6 +297,11 @@ NestedClientCheckEvents(NestedClientPrivatePtr pPriv) {
break;
case MotionNotify:
+ if (!pPriv->dev) {
+ xf86DrvMsg(pPriv->scrnIndex, X_INFO, "Input device is not yet initializedXShmQueryExtension failed. Dropping XShm support.\n");
+ break;
+ }
+
NestedInputPostMouseMotionEvent(pPriv->dev,
((XMotionEvent*)&ev)->x,
((XMotionEvent*)&ev)->y);
@@ -304,11 +309,21 @@ NestedClientCheckEvents(NestedClientPrivatePtr pPriv) {
case ButtonPress:
case ButtonRelease:
+ if (!pPriv->dev) {
+ xf86DrvMsg(pPriv->scrnIndex, X_INFO, "Input device is not yet initializedXShmQueryExtension failed. Dropping XShm support.\n");
+ break;
+ }
+
NestedInputPostButtonEvent(pPriv->dev, ev.xbutton.button, ev.type == ButtonPress);
break;
case KeyPress:
case KeyRelease:
+ if (!pPriv->dev) {
+ xf86DrvMsg(pPriv->scrnIndex, X_INFO, "Input device is not yet initializedXShmQueryExtension failed. Dropping XShm support.\n");
+ break;
+ }
+
NestedInputPostKeyboardEvent(pPriv->dev, ev.xkey.keycode, ev.type == KeyPress);
break;
}