qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] hw/char/pl011: fix receiving multiple chars


From: Zack Marvel
Subject: [PATCH] hw/char/pl011: fix receiving multiple chars
Date: Sun, 21 Feb 2021 08:04:30 -0700

When using the GTK UI with libvte, multicharacter keystrokes are not
sent correctly (such as arrow keys). This is not an issue for e.g. the
SDL UI because qemu_chr_be_write is called with len=1 for each character
(SDL sends more than once keystroke).

Buglink: https://bugs.launchpad.net/qemu/+bug/1407808

Signed-off-by: Zack Marvel <zpmarvel@gmail.com>
---
 hw/char/pl011.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/char/pl011.c b/hw/char/pl011.c
index ea4a4e5235..2ea8fd2685 100644
--- a/hw/char/pl011.c
+++ b/hw/char/pl011.c
@@ -300,7 +300,9 @@ static void pl011_put_fifo(void *opaque, uint32_t value)
 
 static void pl011_receive(void *opaque, const uint8_t *buf, int size)
 {
-    pl011_put_fifo(opaque, *buf);
+    for (int i = 0; i < size; i++) {
+        pl011_put_fifo(opaque, buf[i]);
+    }
 }
 
 static void pl011_event(void *opaque, QEMUChrEvent event)
-- 
2.20.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]