starting a running device or stopping a stopped device isn't allowed
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15203 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1166,11 +1166,14 @@ InputServer::StartStopDevices(const char* name, input_device_type type, bool doS
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (item->Matches(name, type)) {
|
if (item->Matches(name, type)) {
|
||||||
|
if (!doStart ^ item->Running())
|
||||||
|
return B_ERROR;
|
||||||
|
|
||||||
if (doStart)
|
if (doStart)
|
||||||
item->Start();
|
item->Start();
|
||||||
else
|
else
|
||||||
item->Stop();
|
item->Stop();
|
||||||
|
|
||||||
if (name)
|
if (name)
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
@@ -1192,6 +1195,9 @@ InputServer::StartStopDevices(BInputServerDevice& serverDevice, bool doStart)
|
|||||||
|
|
||||||
InputDeviceListItem* item = _FindInputDeviceListItem(serverDevice);
|
InputDeviceListItem* item = _FindInputDeviceListItem(serverDevice);
|
||||||
if (item != NULL) {
|
if (item != NULL) {
|
||||||
|
if (!doStart ^ item->Running())
|
||||||
|
return B_ERROR;
|
||||||
|
|
||||||
if (doStart)
|
if (doStart)
|
||||||
item->Start();
|
item->Start();
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user