LibCore: Don't replay last handled event when leaving nested event loop

The event that triggered the exit from an inner event loop would always
get re-delivered in the outer event loop due to a silly off-by-one
mistake when transferring pending events between loops.
This commit is contained in:
Andreas Kling 2020-04-03 22:55:48 +02:00
parent 9eec63e471
commit eeec1c1293
Notes: sideshowbarker 2024-07-19 07:58:10 +09:00

View file

@ -365,7 +365,7 @@ void EventLoop::pump(WaitMode mode)
#endif
decltype(m_queued_events) new_event_queue;
new_event_queue.ensure_capacity(m_queued_events.size() + events.size());
for (; i < events.size(); ++i)
for (++i; i < events.size(); ++i)
new_event_queue.unchecked_append(move(events[i]));
new_event_queue.append(move(m_queued_events));
m_queued_events = move(new_event_queue);