mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-07-21 14:52:04 +00:00
[idd] helper: hook up exclusive monitor toggle to registry
This commit is contained in:
@@ -52,6 +52,7 @@ CConfigWindow::CConfigWindow() : m_scale(1)
|
|||||||
m_modes = m_settings.getModes();
|
m_modes = m_settings.getModes();
|
||||||
m_defaultRefresh = m_settings.getDefaultRefresh();
|
m_defaultRefresh = m_settings.getDefaultRefresh();
|
||||||
m_noGPU = m_settings.getNoGPU();
|
m_noGPU = m_settings.getNoGPU();
|
||||||
|
m_exclusive = m_settings.getExclusiveMonitor();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!CreateWindowEx(0, MAKEINTATOM(s_atom), L"Looking Glass IDD Configuration",
|
if (!CreateWindowEx(0, MAKEINTATOM(s_atom), L"Looking Glass IDD Configuration",
|
||||||
@@ -187,6 +188,9 @@ LRESULT CConfigWindow::onCreate()
|
|||||||
if (m_noGPU)
|
if (m_noGPU)
|
||||||
m_prefNoGPU->setChecked(*m_noGPU);
|
m_prefNoGPU->setChecked(*m_noGPU);
|
||||||
|
|
||||||
|
if (m_exclusive)
|
||||||
|
m_prefExclusive->setChecked(*m_exclusive);
|
||||||
|
|
||||||
LONG width, height;
|
LONG width, height;
|
||||||
getMinimumSize(width, height);
|
getMinimumSize(width, height);
|
||||||
SetWindowPos(m_hwnd, NULL, 0, 0, width, height, SWP_NOMOVE | SWP_NOZORDER);
|
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_settings.setNoGPU(*m_noGPU);
|
||||||
m_prefNoGPU->setChecked(*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)
|
else if (m_modeSave && hwnd == *m_modeSave && code == BN_CLICKED)
|
||||||
{
|
{
|
||||||
bool updated = false;
|
bool updated = false;
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ class CConfigWindow : public CWindow
|
|||||||
std::optional<std::vector<DisplayMode>> m_modes;
|
std::optional<std::vector<DisplayMode>> m_modes;
|
||||||
std::optional<DWORD> m_defaultRefresh;
|
std::optional<DWORD> m_defaultRefresh;
|
||||||
std::optional<bool> m_noGPU;
|
std::optional<bool> m_noGPU;
|
||||||
|
std::optional<bool> m_exclusive;
|
||||||
|
|
||||||
void getMinimumSize(LONG &width, LONG &height);
|
void getMinimumSize(LONG &width, LONG &height);
|
||||||
void updateFont();
|
void updateFont();
|
||||||
|
|||||||
Reference in New Issue
Block a user