[idd] helper: hook up exclusive monitor toggle to registry

This commit is contained in:
Quantum
2026-07-18 14:51:08 -04:00
committed by Geoffrey McRae
parent 1eb88b3d1e
commit f3d5c7e185
2 changed files with 11 additions and 0 deletions

View File

@@ -52,6 +52,7 @@ CConfigWindow::CConfigWindow() : m_scale(1)
m_modes = m_settings.getModes();
m_defaultRefresh = m_settings.getDefaultRefresh();
m_noGPU = m_settings.getNoGPU();
m_exclusive = m_settings.getExclusiveMonitor();
}
if (!CreateWindowEx(0, MAKEINTATOM(s_atom), L"Looking Glass IDD Configuration",
@@ -187,6 +188,9 @@ LRESULT CConfigWindow::onCreate()
if (m_noGPU)
m_prefNoGPU->setChecked(*m_noGPU);
if (m_exclusive)
m_prefExclusive->setChecked(*m_exclusive);
LONG width, height;
getMinimumSize(width, height);
SetWindowPos(m_hwnd, NULL, 0, 0, width, height, SWP_NOMOVE | SWP_NOZORDER);
@@ -330,6 +334,12 @@ LRESULT CConfigWindow::onCommand(WORD id, WORD code, HWND hwnd)
m_settings.setNoGPU(*m_noGPU);
m_prefNoGPU->setChecked(*m_noGPU);
}
else if (m_prefExclusive && hwnd == *m_prefExclusive && code == BN_CLICKED && m_exclusive)
{
*m_exclusive ^= true;
m_settings.setExclusiveMonitor(*m_exclusive);
m_prefExclusive->setChecked(*m_exclusive);
}
else if (m_modeSave && hwnd == *m_modeSave && code == BN_CLICKED)
{
bool updated = false;

View File

@@ -74,6 +74,7 @@ class CConfigWindow : public CWindow
std::optional<std::vector<DisplayMode>> m_modes;
std::optional<DWORD> m_defaultRefresh;
std::optional<bool> m_noGPU;
std::optional<bool> m_exclusive;
void getMinimumSize(LONG &width, LONG &height);
void updateFont();