X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fimplementations%2FCECCommandHandler.cpp;h=7e4b5478aa7123e05a5021e2713e6da23ca67be2;hb=e1804a4e359f5e188a02705c85e7e666d1d1482e;hp=eed60878d8231244346e80756ef45f39081f9d5d;hpb=3ef1760662ea7d157c97fa4a3d26f8ce7138747f;p=deb_libcec.git diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index eed6087..7e4b547 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -379,11 +379,20 @@ bool CCECCommandHandler::HandleMenuRequest(const cec_command &command) { if (m_processor->IsRunning() && m_busDevice->MyLogicalAddressContains(command.destination)) { - if (command.parameters[0] == CEC_MENU_REQUEST_TYPE_QUERY) + CCECBusDevice *device = GetDevice(command.destination); + if (device) { - CCECBusDevice *device = GetDevice(command.destination); - if (device) - return device->TransmitMenuState(command.initiator); + if (command.parameters[0] == CEC_MENU_REQUEST_TYPE_ACTIVATE) + { + if (CLibCEC::MenuStateChanged(CEC_MENU_STATE_ACTIVATED) == 1) + device->SetMenuState(CEC_MENU_STATE_ACTIVATED); + } + else if (command.parameters[0] == CEC_MENU_REQUEST_TYPE_DEACTIVATE) + { + if (CLibCEC::MenuStateChanged(CEC_MENU_STATE_DEACTIVATED) == 1) + device->SetMenuState(CEC_MENU_STATE_DEACTIVATED); + } + return device->TransmitMenuState(command.initiator); } }