* [Qemu-devel] [PATCH] hw/input/ps2.c: fix erratic mouse behavior for Windows 3.1
@ 2018-08-19 4:35 John Arbuckle
2018-08-20 5:24 ` Gerd Hoffmann
0 siblings, 1 reply; 3+ messages in thread
From: John Arbuckle @ 2018-08-19 4:35 UTC (permalink / raw)
To: pbonzini, rth, ehabkost, kraxel, qemu-devel; +Cc: John Arbuckle
When the user moves the mouse and moves the scroll wheel at the same time, the mouse cursor's movement becomes erratic in Windows 3.1. With this patch if the mouse is in ps/2 mode and the scroll wheel is used, the command queue is reset. This does not fix the erratic mouse problem in Windows NT 4.0.
Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
---
hw/input/ps2.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/hw/input/ps2.c b/hw/input/ps2.c
index fdfcadf9a1..bb9ebfa5a9 100644
--- a/hw/input/ps2.c
+++ b/hw/input/ps2.c
@@ -685,8 +685,17 @@ static int ps2_mouse_send_packet(PS2MouseState *s)
/* update deltas */
s->mouse_dx -= dx1;
s->mouse_dy -= dy1;
- s->mouse_dz -= dz1;
+ /*
+ * This prevents the mouse from going crazy in Windows that doesn't support
+ * the Microsoft Intellimouse standard.
+ */
+ if (s->mouse_type == 0 && s->mouse_dz != 0) {
+ s->mouse_dz = 0;
+ ps2_reset_queue(&s->common);
+ return 1;
+ }
+ s->mouse_dz -= dz1;
return 1;
}
--
2.14.3 (Apple Git-98)
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [Qemu-devel] [PATCH] hw/input/ps2.c: fix erratic mouse behavior for Windows 3.1
2018-08-19 4:35 [Qemu-devel] [PATCH] hw/input/ps2.c: fix erratic mouse behavior for Windows 3.1 John Arbuckle
@ 2018-08-20 5:24 ` Gerd Hoffmann
2018-08-20 14:31 ` Programmingkid
0 siblings, 1 reply; 3+ messages in thread
From: Gerd Hoffmann @ 2018-08-20 5:24 UTC (permalink / raw)
To: John Arbuckle; +Cc: pbonzini, rth, ehabkost, qemu-devel
On Sun, Aug 19, 2018 at 12:35:09AM -0400, John Arbuckle wrote:
> When the user moves the mouse and moves the scroll wheel at the same
> time, the mouse cursor's movement becomes erratic in Windows 3.1. With
> this patch if the mouse is in ps/2 mode and the scroll wheel is used,
> the command queue is reset. This does not fix the erratic mouse
> problem in Windows NT 4.0.
I don't think we need to reset the queue. Just ignoring the z axis
value for type 0 should do. Can you try this?
--- a/hw/input/ps2.c
+++ b/hw/input/ps2.c
@@ -661,6 +661,8 @@ static int ps2_mouse_send_packet(PS2MouseState *s)
/* extra byte for IMPS/2 or IMEX */
switch(s->mouse_type) {
default:
+ s->mouse_dz = 0;
+ dz1 = 0;
break;
case 3:
if (dz1 > 127)
cheers,
Gerd
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [Qemu-devel] [PATCH] hw/input/ps2.c: fix erratic mouse behavior for Windows 3.1
2018-08-20 5:24 ` Gerd Hoffmann
@ 2018-08-20 14:31 ` Programmingkid
0 siblings, 0 replies; 3+ messages in thread
From: Programmingkid @ 2018-08-20 14:31 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: pbonzini, rth, ehabkost, qemu-devel
> On Aug 20, 2018, at 1:24 AM, Gerd Hoffmann <kraxel@redhat.com> wrote:
>
> On Sun, Aug 19, 2018 at 12:35:09AM -0400, John Arbuckle wrote:
>> When the user moves the mouse and moves the scroll wheel at the same
>> time, the mouse cursor's movement becomes erratic in Windows 3.1. With
>> this patch if the mouse is in ps/2 mode and the scroll wheel is used,
>> the command queue is reset. This does not fix the erratic mouse
>> problem in Windows NT 4.0.
>
> I don't think we need to reset the queue. Just ignoring the z axis
> value for type 0 should do. Can you try this?
>
> --- a/hw/input/ps2.c
> +++ b/hw/input/ps2.c
> @@ -661,6 +661,8 @@ static int ps2_mouse_send_packet(PS2MouseState *s)
> /* extra byte for IMPS/2 or IMEX */
> switch(s->mouse_type) {
> default:
> + s->mouse_dz = 0;
> + dz1 = 0;
> break;
> case 3:
> if (dz1 > 127)
>
> cheers,
> Gerd
>
Sorry it did not fix the problem.
https://winworldpc.com/product/windows-3/31
In case you or anyone else wishes to reproduce this problem, the link to the Windows 3.1 installer is above.
Thank you.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-08-20 14:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-19 4:35 [Qemu-devel] [PATCH] hw/input/ps2.c: fix erratic mouse behavior for Windows 3.1 John Arbuckle
2018-08-20 5:24 ` Gerd Hoffmann
2018-08-20 14:31 ` Programmingkid
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.