From 0ea2576032d07c5f48e6196078b2f18539c415c4 Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Thu, 3 Jul 2025 12:40:28 -0400 Subject: [PATCH] refactor: XWindowsEventQueueBuffer, use static const for timeoutd delay --- src/lib/platform/XWindowsEventQueueBuffer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/platform/XWindowsEventQueueBuffer.cpp b/src/lib/platform/XWindowsEventQueueBuffer.cpp index 259e2bd22..22336ad16 100644 --- a/src/lib/platform/XWindowsEventQueueBuffer.cpp +++ b/src/lib/platform/XWindowsEventQueueBuffer.cpp @@ -103,12 +103,12 @@ void XWindowsEventQueueBuffer::waitForEvent(double dtimeout) // and continue doing this until timeout is reached. // The human eye can notice 60hz (ansi) which is 16ms, however // we want to give the cpu a chance s owe up this to 25ms -#define TIMEOUT_DELAY 25 + static const int s_timeoutDelay = 25; while (((dtimeout < 0.0) || (remaining > 0)) && getPendingCountLocked() == 0 && retval == 0) { - retval = poll(pfds, 2, TIMEOUT_DELAY); // 16ms = 60hz, but we make it > to - // play nicely with the cpu + retval = poll(pfds, 2, s_timeoutDelay); // 16ms = 60hz, but we make it > to + // play nicely with the cpu if (pfds[1].revents & POLLIN) { ssize_t read_response = read(m_pipefd[0], buf, 15); @@ -117,7 +117,7 @@ void XWindowsEventQueueBuffer::waitForEvent(double dtimeout) // todo: handle read response } } - remaining -= TIMEOUT_DELAY; + remaining -= s_timeoutDelay; } {