From: Richard Henderson <richard.henderson@linaro.org>
To: "Carl Hauser" <chauser@pullman.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [PATCH] hw/char: suppress sunmouse events with no changes
Date: Tue, 20 Aug 2024 17:34:14 +1000 [thread overview]
Message-ID: <d8bbf72d-29e5-465b-a8aa-508ed2960631@linaro.org> (raw)
In-Reply-To: <cb338cdc-d09d-4513-ba16-5ff3f792bbfe@pullman.com>
On 8/20/24 09:18, Carl Hauser wrote:
> @@ -959,6 +960,15 @@ static void sunmouse_event(void *opaque,
> int ch;
>
> trace_escc_sunmouse_event(dx, dy, buttons_state);
> +
> + /* Don't send duplicate events without motion */
> + if (dx == 0 &&
> + dy == 0 &&
> + (s->sunmouse_prev_state ^ buttons_state) == 0) {
Were you intending to mask vs MOUSE_EVENT_*BUTTON?
Otherwise this is just plain equality.
> diff --git a/include/hw/char/escc.h b/include/hw/char/escc.h
> index 5669a5b811..bc5ba4f564 100644
> --- a/include/hw/char/escc.h
> +++ b/include/hw/char/escc.h
> @@ -46,6 +46,7 @@ typedef struct ESCCChannelState {
> uint8_t rx, tx;
> QemuInputHandlerState *hs;
> char *sunkbd_layout;
> + int sunmouse_prev_state;
This adds new state that must be migrated.
While the patch is relatively simple, I do wonder if this code could be improved by
converting away from the legacy mouse interface to qemu_input_handler_register.
Especially if that might help avoid needing to add migration state that isn't "really"
part of the device.
Mark?
r~
next prev parent reply other threads:[~2024-08-20 7:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-19 23:18 [PATCH] hw/char: suppress sunmouse events with no changes Carl Hauser
2024-08-20 7:34 ` Richard Henderson [this message]
2024-08-20 16:58 ` Carl Hauser
2024-08-21 14:18 ` Mark Cave-Ayland
2024-08-21 17:14 ` Carl Hauser via
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=d8bbf72d-29e5-465b-a8aa-508ed2960631@linaro.org \
--to=richard.henderson@linaro.org \
--cc=chauser@pullman.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@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).