mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-09 20:24:14 +00:00
[idd] driver: improve display mode support and resolution switch
This commit is contained in:
@@ -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);
|
||||
}
|
@@ -46,6 +46,7 @@ private:
|
||||
void SetActiveDesktop();
|
||||
|
||||
void HandleSetCursorPos(const LGPipeMsg& msg);
|
||||
void HandleSetDisplayMode(const LGPipeMsg& msg);
|
||||
|
||||
public:
|
||||
~CPipeClient() { DeInit(); }
|
||||
|
Reference in New Issue
Block a user