qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Zack Marvel <zpmarvel@gmail.com>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, Peter Maydell <peter.maydell@linaro.org>,
	Zack Marvel <zpmarvel@gmail.com>,
	qemu-arm@nongnu.org
Subject: [PATCH] hw/char/pl011: fix receiving multiple chars
Date: Sun, 21 Feb 2021 08:04:30 -0700	[thread overview]
Message-ID: <20210221150430.6223-1-zpmarvel@gmail.com> (raw)

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	other threads:[~2021-02-21 15:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-21 15:04 Zack Marvel [this message]
2021-02-21 15:19 ` [PATCH] hw/char/pl011: fix receiving multiple chars Peter Maydell
2021-02-21 16:37   ` Zack Marvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210221150430.6223-1-zpmarvel@gmail.com \
    --to=zpmarvel@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).