From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Shiyuan Gao <gaoshiyuan@baidu.com>
Cc: qemu-devel@nongnu.org, "Gerd Hoffmann" <kraxel@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
"Peter Maydell" <peter.maydell@linaro.org>
Subject: Re: [PATCH] vnc,ps2: fix the PS/2 mouse work badly when connect VNC
Date: Mon, 17 Jul 2023 11:04:01 +0100 [thread overview]
Message-ID: <ZLUSEb4w0ZtzwB1H@redhat.com> (raw)
In-Reply-To: <20230717025936.71456-1-gaoshiyuan@baidu.com>
On Mon, Jul 17, 2023 at 10:59:36AM +0800, Shiyuan Gao wrote:
> When only use PS/2 mouse without usb-tablet, the mouse pointer of the
> guest on the VNC will work badly that the cursor of VNC is inconsistent
> with the mouse pointer of guest.
>
> The reason is the PS/2 mouse use relative coordinates and we can't know
> the initial position of the guest mouse pointer.
>
> So move the guest mouse pointer to (0, 0) of the screen when connect the
> VNC, and then move the mouse pointer to the cursor of VNC(absolute
> coordinates are also relative coordinates).
This is not a solution, because even if you know the starting position
of the pointer, the host/guest pointers can have different motion
acceleration behaviour, so they'll loose sync with each other. You'll
have problems such as the host pointer exiting the VNC window before
the guest pointer has got to the far edge.
Trying to make a relative pointer work correctly in combination with
absolute input events from VNC is never going to work.
This is why QEMU created a VNC extension to allows switching the VNC
protocol from absolute to relative pointer motion events.
If you need to run a VM with only the PS/2 pointer, then you need
to be using a client that supports this extension:
https://github.com/rfbproto/rfbproto/blob/master/rfbproto.rst#qemu-pointer-motion-change-pseudo-encoding
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2023-07-17 10:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-17 2:59 [PATCH] vnc,ps2: fix the PS/2 mouse work badly when connect VNC Shiyuan Gao
2023-07-17 7:40 ` Marc-André Lureau
2023-07-17 8:53 ` Gao,Shiyuan
2023-07-17 9:16 ` Marc-André Lureau
2023-07-17 10:05 ` Daniel P. Berrangé
2023-07-17 12:52 ` Gao,Shiyuan
2023-07-17 13:12 ` Marc-André Lureau
2023-07-17 13:41 ` Gao,Shiyuan
2023-07-17 14:05 ` Marc-André Lureau
2023-07-18 2:07 ` Gao,Shiyuan
2023-07-17 10:04 ` Daniel P. Berrangé [this message]
2023-07-17 12:49 ` Gao,Shiyuan
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=ZLUSEb4w0ZtzwB1H@redhat.com \
--to=berrange@redhat.com \
--cc=gaoshiyuan@baidu.com \
--cc=kraxel@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=peter.maydell@linaro.org \
--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).