[idd] debounce resolution changes

This commit is contained in:
Geoffrey McRae
2026-07-16 19:32:12 +10:00
parent 1ce446f97a
commit 5e6d88f382
2 changed files with 72 additions and 2 deletions

View File

@@ -153,6 +153,15 @@ private:
CSettings::DisplayMode m_setMode = {};
bool m_doSetMode = false;
// Debounce for resolution changes. A window resize streams many WINDOWSIZE
// requests in quick succession; rather than replug the monitor for each, we
// (re)start a timer and only apply the last requested resolution once it has
// remained unchanged for m_resChangeDelayMs. Guarded by m_stateLock.
static const ULONG m_resChangeDelayMs = 1000;
WDFTIMER m_resChangeTimer = nullptr;
CSettings::DisplayMode m_pendingMode = {};
bool m_resChangePending = false;
// Set by ReplugMonitor after a departure to rebuild the monitor from the LGMP
// timer, off the IddCx callback thread.
volatile LONG m_finishInitQueued = 0;
@@ -188,6 +197,7 @@ public:
#endif
void SetResolution(int width, int height);
void ApplyResolution();
size_t GetAlignSize () const { return m_alignSize ; }
size_t GetMaxFrameSize() const { return m_maxFrameSize ; }