[idd] driver: improve display mode support and resolution switch

This commit is contained in:
Geoffrey McRae
2025-03-29 22:37:33 +00:00
parent 6396ff1e9c
commit 7afb9b93eb
10 changed files with 194 additions and 60 deletions

View File

@@ -211,6 +211,10 @@ void CPipeClient::Thread()
HandleSetCursorPos(msg);
break;
case LGPipeMsg::SETDISPLAYMODE:
HandleSetDisplayMode(msg);
break;
default:
DEBUG_ERROR("Unknown message type %d", msg.type);
break;
@@ -228,4 +232,17 @@ void CPipeClient::HandleSetCursorPos(const LGPipeMsg& msg)
{
SetActiveDesktop();
SetCursorPos(msg.curorPos.x, msg.curorPos.y);
}
void CPipeClient::HandleSetDisplayMode(const LGPipeMsg& msg)
{
DEVMODE dm = {};
dm.dmSize = sizeof(dm);
dm.dmPelsWidth = msg.displayMode.width;
dm.dmPelsHeight = msg.displayMode.height;
dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;
LONG result = ChangeDisplaySettingsEx(NULL, &dm, NULL, CDS_UPDATEREGISTRY, NULL);
if (result != DISP_CHANGE_SUCCESSFUL)
DEBUG_ERROR("ChangeDisplaySettingsEx Failed (0x%08x)", result);
}

View File

@@ -46,6 +46,7 @@ private:
void SetActiveDesktop();
void HandleSetCursorPos(const LGPipeMsg& msg);
void HandleSetDisplayMode(const LGPipeMsg& msg);
public:
~CPipeClient() { DeInit(); }