Compare commits

..

2 Commits

Author SHA1 Message Date
Geoffrey McRae
b069a2363c [idd] project: cleanup vcxproj.filters mess
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
2026-06-03 22:48:23 +10:00
Geoffrey McRae
b77b36aff0 [idd] ipc/helper: notify the helper if a software renderer is in use 2026-06-03 22:48:16 +10:00
2 changed files with 8 additions and 25 deletions

View File

@@ -89,7 +89,7 @@ void CConfigWindow::updateFont()
} }
for (HWND child : std::initializer_list<HWND>({ for (HWND child : std::initializer_list<HWND>({
*m_version, *m_modeGroup, *m_modeBox, *m_widthLabel, *m_heightLabel, *m_refreshLabel, *m_modePreferred, *m_version, *m_modeGroup, *m_modeBox, *m_widthLabel, *m_heightLabel, *m_refreshLabel,
*m_modeWidth, *m_modeHeight, *m_modeRefresh, *m_modeUpdate, *m_modeDelete, *m_modeReset, *m_modeWidth, *m_modeHeight, *m_modeRefresh, *m_modeUpdate, *m_modeDelete, *m_modeReset,
*m_autosizeGroup, *m_defRefreshLabel, *m_defRefresh, *m_defRefreshHz, *m_autosizeGroup, *m_defRefreshLabel, *m_defRefresh, *m_defRefreshHz,
*m_prefGroup, *m_prefNoGPU, *m_prefGroup, *m_prefNoGPU,
@@ -97,20 +97,13 @@ void CConfigWindow::updateFont()
SendMessage(child, WM_SETFONT, (WPARAM)m_font.Get(), 1); SendMessage(child, WM_SETFONT, (WPARAM)m_font.Get(), 1);
} }
int CConfigWindow::updateModeList(int wanted) void CConfigWindow::updateModeList()
{ {
int result = 0;
m_modeBox->addItem(L"<add new>", -1); m_modeBox->addItem(L"<add new>", -1);
auto &modes = *m_modes; auto &modes = *m_modes;
for (size_t i = 0; i < modes.size(); ++i) for (size_t i = 0; i < modes.size(); ++i)
{ m_modeBox->addItem(modes[i].toString(), i);
int idx = m_modeBox->addItem(modes[i].toString(), i);
if (wanted == i)
result = idx;
}
return result;
} }
LRESULT CConfigWindow::handleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) LRESULT CConfigWindow::handleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
@@ -161,7 +154,6 @@ LRESULT CConfigWindow::onCreate()
m_modeWidth.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_LEFT | ES_NUMBER, m_hwnd)); m_modeWidth.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_LEFT | ES_NUMBER, m_hwnd));
m_modeHeight.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_LEFT | ES_NUMBER, m_hwnd)); m_modeHeight.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_LEFT | ES_NUMBER, m_hwnd));
m_modeRefresh.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_LEFT | ES_NUMBER, m_hwnd)); m_modeRefresh.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_LEFT | ES_NUMBER, m_hwnd));
m_modePreferred.reset(new CCheckbox(L"prefer", WS_CHILD | WS_VISIBLE, m_hwnd));
m_modeUpdate.reset(new CButton(L"Save", WS_CHILD | WS_VISIBLE | WS_TABSTOP, m_hwnd)); m_modeUpdate.reset(new CButton(L"Save", WS_CHILD | WS_VISIBLE | WS_TABSTOP, m_hwnd));
m_modeDelete.reset(new CButton(L"Delete", WS_CHILD | WS_VISIBLE | WS_TABSTOP, m_hwnd)); m_modeDelete.reset(new CButton(L"Delete", WS_CHILD | WS_VISIBLE | WS_TABSTOP, m_hwnd));
@@ -214,7 +206,6 @@ LRESULT CConfigWindow::onResize(DWORD width, DWORD height)
pos.pinBottomLeft(*m_modeWidth, 75, 96, 50, 20); pos.pinBottomLeft(*m_modeWidth, 75, 96, 50, 20);
pos.pinBottomLeft(*m_modeHeight, 75, 72, 50, 20); pos.pinBottomLeft(*m_modeHeight, 75, 72, 50, 20);
pos.pinBottomLeft(*m_modeRefresh, 75, 48, 50, 20); pos.pinBottomLeft(*m_modeRefresh, 75, 48, 50, 20);
pos.pinBottomLeft(*m_modePreferred, 130, 96, 70, 20);
pos.pinBottomLeft(*m_modeUpdate, 24, 20, 50, 24); pos.pinBottomLeft(*m_modeUpdate, 24, 20, 50, 24);
pos.pinBottomLeft(*m_modeDelete, 75, 20, 50, 24); pos.pinBottomLeft(*m_modeDelete, 75, 20, 50, 24);
pos.pinBottomLeft(*m_modeReset, 126, 20, 50, 24); pos.pinBottomLeft(*m_modeReset, 126, 20, 50, 24);
@@ -247,7 +238,6 @@ void CConfigWindow::onModeListSelectChange()
m_modeWidth->setNumericValue(mode.width); m_modeWidth->setNumericValue(mode.width);
m_modeHeight->setNumericValue(mode.height); m_modeHeight->setNumericValue(mode.height);
m_modeRefresh->setNumericValue(mode.refresh); m_modeRefresh->setNumericValue(mode.refresh);
m_modePreferred->setChecked(mode.preferred);
} }
EnableWindow(*m_modeUpdate, TRUE); EnableWindow(*m_modeUpdate, TRUE);
EnableWindow(*m_modeDelete, index >= 0); EnableWindow(*m_modeDelete, index >= 0);
@@ -259,10 +249,6 @@ LRESULT CConfigWindow::onCommand(WORD id, WORD code, HWND hwnd)
{ {
onModeListSelectChange(); onModeListSelectChange();
} }
else if (m_modePreferred && hwnd == *m_modePreferred && code == BN_CLICKED && m_modes)
{
m_modePreferred->setChecked(!m_modePreferred->isChecked());
}
else if (m_modeUpdate && hwnd == *m_modeUpdate && code == BN_CLICKED && m_modes) else if (m_modeUpdate && hwnd == *m_modeUpdate && code == BN_CLICKED && m_modes)
{ {
int sel = m_modeBox->getSel(); int sel = m_modeBox->getSel();
@@ -272,23 +258,21 @@ LRESULT CConfigWindow::onCommand(WORD id, WORD code, HWND hwnd)
int index = m_modeBox->getData(sel); int index = m_modeBox->getData(sel);
auto &mode = index >= 0 ? (*m_modes)[index] : m_modes->emplace_back(); auto &mode = index >= 0 ? (*m_modes)[index] : m_modes->emplace_back();
for (auto &mode : *m_modes)
mode.preferred = false;
try try
{ {
mode.width = m_modeWidth->getNumericValue(); mode.width = m_modeWidth->getNumericValue();
mode.height = m_modeHeight->getNumericValue(); mode.height = m_modeHeight->getNumericValue();
mode.refresh = m_modeRefresh->getNumericValue(); mode.refresh = m_modeRefresh->getNumericValue();
mode.preferred = m_modePreferred->isChecked();
} }
catch (std::logic_error&) catch (std::logic_error&)
{ {
return 0; return 0;
} }
m_modeBox->clear(); if (index >= 0)
m_modeBox->setSel(updateModeList(index)); m_modeBox->delItem(sel);
m_modeBox->setSel(m_modeBox->addItem(mode.toString().c_str(), index));
LRESULT result = m_settings.setModes(*m_modes); LRESULT result = m_settings.setModes(*m_modes);
if (result != ERROR_SUCCESS) if (result != ERROR_SUCCESS)

View File

@@ -49,7 +49,6 @@ class CConfigWindow : public CWindow
std::unique_ptr<CEditWidget> m_modeWidth; std::unique_ptr<CEditWidget> m_modeWidth;
std::unique_ptr<CEditWidget> m_modeHeight; std::unique_ptr<CEditWidget> m_modeHeight;
std::unique_ptr<CEditWidget> m_modeRefresh; std::unique_ptr<CEditWidget> m_modeRefresh;
std::unique_ptr<CCheckbox> m_modePreferred;
std::unique_ptr<CButton> m_modeUpdate; std::unique_ptr<CButton> m_modeUpdate;
std::unique_ptr<CButton> m_modeDelete; std::unique_ptr<CButton> m_modeDelete;
@@ -73,7 +72,7 @@ class CConfigWindow : public CWindow
void getMinimumSize(LONG &width, LONG &height); void getMinimumSize(LONG &width, LONG &height);
void updateFont(); void updateFont();
int updateModeList(int wanted = -1); void updateModeList();
void onModeListSelectChange(); void onModeListSelectChange();
virtual LRESULT handleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) override; virtual LRESULT handleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) override;