qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: "Andreas Färber" <andreas.faerber@web.de>
Cc: qemu-devel <qemu-devel@nongnu.org>, Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] usb-hid: Fix 0/0 position for Windows in tablet mode
Date: Sun, 26 Jun 2011 11:11:29 +0200	[thread overview]
Message-ID: <4E06F7C1.30507@web.de> (raw)
In-Reply-To: <9B636835-1A44-4B01-A92D-7CECD3039669@web.de>

[-- Attachment #1: Type: text/plain, Size: 1490 bytes --]

On 2011-06-25 15:10, Andreas Färber wrote:
> Am 25.06.2011 um 14:55 schrieb Jan Kiszka:
> 
>> On 2011-06-25 14:37, Andreas Färber wrote:
>>> Am 24.06.2011 um 16:27 schrieb Jan Kiszka:
>>>
>>>> For unknown reasons, Windows drivers (tested with XP and Win7) ignore
>>>> usb-tablet events that move the pointer to 0/0. So always set bit 0 of
>>>> the coordinates.
>>>>
>>>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>>>> ---
>>>> hw/usb-hid.c |    6 ++++--
>>>> 1 files changed, 4 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/hw/usb-hid.c b/hw/usb-hid.c
>>>> index d711b5c..2b9a451 100644
>>>> --- a/hw/usb-hid.c
>>>> +++ b/hw/usb-hid.c
>>>> @@ -457,8 +457,10 @@ static void
>>>> usb_pointer_event_combine(USBPointerEvent *e, int xyrel,
>>>>        e->xdx += x1;
>>>>        e->ydy += y1;
>>>>    } else {
>>>> -        e->xdx = x1;
>>>> -        e->ydy = y1;
>>>> +        /* Windows drivers do not like the 0/0 position and ignore
>>>> such
>>>> +         * events. */
>>>> +        e->xdx = x1 | 1;
>>>> +        e->ydy = y1 | 1;
>>>
>>> Doesn't this change mean we can't access any other even pixel either?
>>
>> Only on 32767x32767 screens (that's the resolution of the tablet).
> 
> Well, if it's just a fix for 0/0 I would've expected something like:
> 
> e->xdx = x1 ? x1 : 1;
> e->ydy = y1 ? y1 : 1;

Works as well, my version is a little bit simpler. But I don't mind,
will post whatever is preferred to fix this.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

  reply	other threads:[~2011-06-26  9:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-24 14:27 [Qemu-devel] [PATCH] usb-hid: Fix 0/0 position for Windows in tablet mode Jan Kiszka
2011-06-25 12:37 ` Andreas Färber
2011-06-25 12:55   ` Jan Kiszka
2011-06-25 13:10     ` Andreas Färber
2011-06-26  9:11       ` Jan Kiszka [this message]
2011-07-04 18:15         ` andrzej zaborowski
2011-07-12  7:47           ` [Qemu-devel] [PATCH v2] " Jan Kiszka
2011-07-13 21:05             ` Andreas Färber
2011-07-30  5:51               ` andrzej zaborowski

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=4E06F7C1.30507@web.de \
    --to=jan.kiszka@web.de \
    --cc=andreas.faerber@web.de \
    --cc=kraxel@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).