diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c index 9a8f432a0556..9c1da344c4a3 100644 --- a/hw/xfree86/common/xf86Events.c +++ b/hw/xfree86/common/xf86Events.c @@ -436,8 +436,11 @@ xf86VTLeave(void) else xf86DisableGeneralHandler(ih); } + + //LogMessageVerb(X_INFO, 0, "xf86DisableInputDevs ...\n"); for (pInfo = xf86InputDevs; pInfo; pInfo = pInfo->next) xf86DisableInputDeviceForVTSwitch(pInfo); + //LogMessageVerb(X_INFO, 0, "xf86DisableInputDevs done, doing input_lock ...\n"); input_lock(); for (i = 0; i < xf86NumScreens; i++) diff --git a/os/inputthread.c b/os/inputthread.c index ab1559fb6b95..abbf1825589b 100644 --- a/os/inputthread.c +++ b/os/inputthread.c @@ -190,8 +190,12 @@ InputThreadRegisterDev(int fd, { InputThreadDevice *dev, *old; - if (!inputThreadInfo) + LogMessageVerb(X_INFO, 0, "%s(fd=%d) ... \n", + __func__, fd); + + if (!inputThreadInfo) { return SetNotifyFd(fd, readInputProc, X_NOTIFY_READ, readInputArgs); + } input_lock(); @@ -204,6 +208,8 @@ InputThreadRegisterDev(int fd, } if (dev) { + LogMessageVerb(X_INFO, 0, "%s: found a device: fd=%d state=%d \n", + __func__, fd, (int)(dev->state - device_state_added)); dev->readInputProc = readInputProc; dev->readInputArgs = readInputArgs; /* Override possible unhandled state == device_state_removed */ @@ -246,6 +252,9 @@ InputThreadUnregisterDev(int fd) InputThreadDevice *dev; Bool found_device = FALSE; + LogMessageVerb(X_INFO, 0, "%s(fd=%d) ... \n", + __func__, fd); + /* return silently if input thread is already finished (e.g., at * DisableDevice time, evdev tries to call this function again through * xf86RemoveEnabledDevice) */ @@ -267,6 +276,8 @@ InputThreadUnregisterDev(int fd) return 0; } + LogMessageVerb(X_INFO, 0, "%s: found a device: fd=%d state=%d \n", + __func__, fd, (int)(dev->state - device_state_added)); dev->state = device_state_removed; inputThreadInfo->changed = TRUE; @@ -332,11 +343,16 @@ InputThreadDoWork(void *arg) if (inputThreadInfo->changed) { InputThreadDevice *dev, *tmp; + LogMessageVerb(X_INFO, 0, "inputh lock ...\n"); input_lock(); + LogMessageVerb(X_INFO, 0, "inputh locked\n"); + inputThreadInfo->changed = FALSE; xorg_list_for_each_entry_safe(dev, tmp, &inputThreadInfo->devs, node) { switch (dev->state) { case device_state_added: + LogMessageVerb(X_INFO, 0, "dev fd=%d state=%d \n", + (int)dev->fd, (int)(dev->state - device_state_added)); ospoll_add(inputThreadInfo->fds, dev->fd, ospoll_trigger_level, InputReady, @@ -347,6 +363,8 @@ InputThreadDoWork(void *arg) case device_state_running: break; case device_state_removed: + LogMessageVerb(X_INFO, 0, "dev fd=%d state=%d \n", + (int)dev->fd, (int)(dev->state - device_state_added)); ospoll_remove(inputThreadInfo->fds, dev->fd); xorg_list_del(&dev->node); free(dev);