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 <pengyiqiang@xiaomi.com>
This commit is contained in:
pengyiqiang 2023-04-04 19:40:03 +08:00 committed by Alan Carvalho de Assis
parent b2c8b5f674
commit 961b86642a

View File

@ -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)