diff --git a/src/servers/input/InputServer.cpp b/src/servers/input/InputServer.cpp index 7cc814b7e0..c0b16fcd39 100644 --- a/src/servers/input/InputServer.cpp +++ b/src/servers/input/InputServer.cpp @@ -1166,11 +1166,14 @@ InputServer::StartStopDevices(const char* name, input_device_type type, bool doS continue; if (item->Matches(name, type)) { + if (!doStart ^ item->Running()) + return B_ERROR; + if (doStart) item->Start(); else item->Stop(); - + if (name) return B_OK; } @@ -1192,6 +1195,9 @@ InputServer::StartStopDevices(BInputServerDevice& serverDevice, bool doStart) InputDeviceListItem* item = _FindInputDeviceListItem(serverDevice); if (item != NULL) { + if (!doStart ^ item->Running()) + return B_ERROR; + if (doStart) item->Start(); else