From 961b86642af7618b2dd9db1b1dd2a754f021c682 Mon Sep 17 00:00:00 2001 From: pengyiqiang Date: Tue, 4 Apr 2023 19:40:03 +0800 Subject: [PATCH] sim_x11eventloop: fix X11 event accumulation sim_x11events should process all x11 events in each event loop, otherwise it will cause events to accumulate in the queue and affect the interaction. Signed-off-by: pengyiqiang --- arch/sim/src/sim/posix/sim_x11eventloop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/sim/src/sim/posix/sim_x11eventloop.c b/arch/sim/src/sim/posix/sim_x11eventloop.c index 4839dfb212..874a2ea645 100644 --- a/arch/sim/src/sim/posix/sim_x11eventloop.c +++ b/arch/sim/src/sim/posix/sim_x11eventloop.c @@ -103,9 +103,9 @@ void sim_x11events(void) { XEvent event; - /* Check if there are any pending, queue X11 events. */ + /* Dequeue any pending X11 events. */ - if (g_display && XPending(g_display) > 0) + while (g_display && XPending(g_display) > 0) { /* Yes, get the event (this should not block since we know there are * pending events)