* [Qemu-devel] WinXP mouse patch
@ 2004-04-15 22:59 Mark Jonckheere
2004-04-16 22:55 ` Gregory Alexander
0 siblings, 1 reply; 3+ messages in thread
From: Mark Jonckheere @ 2004-04-15 22:59 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 366 bytes --]
The following patch against the latest CVS (13 april) resolved
for me the slow mouse movements in WinXP. It removes from the
datastream dummy mouse-events that contain no movement or
button-change. This is probably the same problem as in Win2K.
to apply the patch:
save attachment
cd qemu/hw
patch -p0 < /path/to/pckbd.diff
cd ..
make
Happy testing,
Mark.
--
:wq
[-- Attachment #2: pckbd.diff --]
[-- Type: text/plain, Size: 546 bytes --]
--- pckbd.c.orig Sat Apr 10 21:04:48 2004
+++ pckbd.c Fri Apr 16 00:24:27 2004
@@ -442,9 +442,14 @@
if (!(s->mouse_status & MOUSE_STATUS_ENABLED))
return;
+#ifdef DEBUG_MOUSE
+ printf("MOUSE %d %d %d %d\n", dx, dy, dz, buttons_state);
+#endif
s->mouse_dx += dx;
s->mouse_dy -= dy;
s->mouse_dz += dz;
+ if (s->mouse_dx == 0 && s->mouse_dy == 0 && s->mouse_dz == 0 && s->mouse_buttons == buttons_state)
+ return;
s->mouse_buttons = buttons_state;
if (!(s->mouse_status & MOUSE_STATUS_REMOTE) &&
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] WinXP mouse patch
2004-04-15 22:59 [Qemu-devel] WinXP mouse patch Mark Jonckheere
@ 2004-04-16 22:55 ` Gregory Alexander
0 siblings, 0 replies; 3+ messages in thread
From: Gregory Alexander @ 2004-04-16 22:55 UTC (permalink / raw)
To: qemu-devel
I made this same change in bochs to make the mouse usable there. At
least under linux I think it has to do with X sending the events even
when they're not really needed. From Mike Nordell's post, it sounds
like SDL just blindly forwards those events on without filtering.
Also, (although I don't know much about the qemu event queue) it might
make sense to add the capability to merge multiple outstanding mouse
events into a single event. This made a BIG difference on bochs, and
could help in QEMU as well, if for no other reason than saving CPU cycles.
GREG
Mark Jonckheere wrote:
> The following patch against the latest CVS (13 april) resolved
> for me the slow mouse movements in WinXP. It removes from the
> datastream dummy mouse-events that contain no movement or
> button-change. This is probably the same problem as in Win2K.
>
> to apply the patch:
> save attachment
> cd qemu/hw
> patch -p0 < /path/to/pckbd.diff
> cd ..
> make
>
> Happy testing,
> Mark.
>
>
> ------------------------------------------------------------------------
>
> --- pckbd.c.orig Sat Apr 10 21:04:48 2004
> +++ pckbd.c Fri Apr 16 00:24:27 2004
> @@ -442,9 +442,14 @@
> if (!(s->mouse_status & MOUSE_STATUS_ENABLED))
> return;
>
> +#ifdef DEBUG_MOUSE
> + printf("MOUSE %d %d %d %d\n", dx, dy, dz, buttons_state);
> +#endif
> s->mouse_dx += dx;
> s->mouse_dy -= dy;
> s->mouse_dz += dz;
> + if (s->mouse_dx == 0 && s->mouse_dy == 0 && s->mouse_dz == 0 && s->mouse_buttons == buttons_state)
> + return;
> s->mouse_buttons = buttons_state;
>
> if (!(s->mouse_status & MOUSE_STATUS_REMOTE) &&
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://mail.nongnu.org/mailman/listinfo/qemu-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] WinXP mouse patch
@ 2004-04-16 5:17 Mike Nordell
0 siblings, 0 replies; 3+ messages in thread
From: Mike Nordell @ 2004-04-16 5:17 UTC (permalink / raw)
To: qemu-devel
Mark Jonckheere wrote:
> The following patch against the latest CVS (13 april) resolved
> for me the slow mouse movements in WinXP.
Looking at it, I see difference between hosts and do one observation.
The difference is that QEMU on Win32 isn't as far as I have observed or
experienced plagued by this problem. The observation is that if SDL did its
job, this patch would be "dead code" - a code path never taken, why it seems
to me to be an SDL problem/bug related to your specific host OS. Could you
verify this?
I base that observation on the fact that kbd_mouse_event() should only be
called from sdl_send_mouse_event() in sdl.c, which in turn should only be
called when an SDL event of type SDL_MOUSEMOTION, SDL_MOUSEBUTTONDOWN or
SDL_MOUSEBUTTONUP is recieved. If you get SDL_MOUSEMOTION with with dx&dy =
0 from SDL_GetRelativeMouseState, I can't see any other explanation than an
SDL problem.
That said, since it apparently solves a real problem I too think the patch
should be included, with the addition of a comment explaining why that code
is there.
/Mike
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-04-16 23:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-15 22:59 [Qemu-devel] WinXP mouse patch Mark Jonckheere
2004-04-16 22:55 ` Gregory Alexander
-- strict thread matches above, loose matches on Subject: below --
2004-04-16 5:17 Mike Nordell
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).