From 2bf78c42ddd0cf0efc297b3455aec4420632b988 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Mon, 19 Sep 2011 19:32:15 -0700 Subject: 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 --- src/xlibclient.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src') 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; } -- cgit v1.2.3