From 01a2035ecffe1c9ea8321f84d599e74bcaf817b5 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 17 Mar 2019 01:34:31 +0100 Subject: [PATCH] LibGUI: Don't nap in event loop if there are already queued events. This mirrors the WindowServer fix. --- LibGUI/GEventLoop.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LibGUI/GEventLoop.cpp b/LibGUI/GEventLoop.cpp index aa4428c11e6..2015a65ae7a 100644 --- a/LibGUI/GEventLoop.cpp +++ b/LibGUI/GEventLoop.cpp @@ -238,7 +238,7 @@ void GEventLoop::wait_for_event() } struct timeval timeout = { 0, 0 }; - if (!m_timers.is_empty()) + if (!m_timers.is_empty() && m_queued_events.is_empty()) get_next_timer_expiration(timeout); ASSERT(m_unprocessed_messages.is_empty()); int rc = select(max_fd + 1, &rfds, &wfds, nullptr, (m_queued_events.is_empty() && m_timers.is_empty()) ? nullptr : &timeout);