* [Qemu-devel] [PATCH] usb-hid: Fix 0/0 position for Windows in tablet mode @ 2011-06-24 14:27 Jan Kiszka 2011-06-25 12:37 ` Andreas Färber 0 siblings, 1 reply; 9+ messages in thread From: Jan Kiszka @ 2011-06-24 14:27 UTC (permalink / raw) To: qemu-devel, Gerd Hoffmann 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; } e->dz += z1; } ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH] usb-hid: Fix 0/0 position for Windows in tablet mode 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 0 siblings, 1 reply; 9+ messages in thread From: Andreas Färber @ 2011-06-25 12:37 UTC (permalink / raw) To: Jan Kiszka; +Cc: qemu-devel, Gerd Hoffmann 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? Andreas > } > e->dz += z1; > } ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH] usb-hid: Fix 0/0 position for Windows in tablet mode 2011-06-25 12:37 ` Andreas Färber @ 2011-06-25 12:55 ` Jan Kiszka 2011-06-25 13:10 ` Andreas Färber 0 siblings, 1 reply; 9+ messages in thread From: Jan Kiszka @ 2011-06-25 12:55 UTC (permalink / raw) To: Andreas Färber; +Cc: qemu-devel, Gerd Hoffmann [-- Attachment #1: Type: text/plain, Size: 1083 bytes --] 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). Jan [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 259 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH] usb-hid: Fix 0/0 position for Windows in tablet mode 2011-06-25 12:55 ` Jan Kiszka @ 2011-06-25 13:10 ` Andreas Färber 2011-06-26 9:11 ` Jan Kiszka 0 siblings, 1 reply; 9+ messages in thread From: Andreas Färber @ 2011-06-25 13:10 UTC (permalink / raw) To: Jan Kiszka; +Cc: qemu-devel, Gerd Hoffmann 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; Andreas ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH] usb-hid: Fix 0/0 position for Windows in tablet mode 2011-06-25 13:10 ` Andreas Färber @ 2011-06-26 9:11 ` Jan Kiszka 2011-07-04 18:15 ` andrzej zaborowski 0 siblings, 1 reply; 9+ messages in thread From: Jan Kiszka @ 2011-06-26 9:11 UTC (permalink / raw) To: Andreas Färber; +Cc: qemu-devel, Gerd Hoffmann [-- 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 --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH] usb-hid: Fix 0/0 position for Windows in tablet mode 2011-06-26 9:11 ` Jan Kiszka @ 2011-07-04 18:15 ` andrzej zaborowski 2011-07-12 7:47 ` [Qemu-devel] [PATCH v2] " Jan Kiszka 0 siblings, 1 reply; 9+ messages in thread From: andrzej zaborowski @ 2011-07-04 18:15 UTC (permalink / raw) To: Jan Kiszka; +Cc: Andreas Färber, qemu-devel, Gerd Hoffmann On 26 June 2011 11:11, Jan Kiszka <jan.kiszka@web.de> wrote: > 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. Would it be enough to just do this for x or y, not both? Cheers ^ permalink raw reply [flat|nested] 9+ messages in thread
* [Qemu-devel] [PATCH v2] usb-hid: Fix 0/0 position for Windows in tablet mode 2011-07-04 18:15 ` andrzej zaborowski @ 2011-07-12 7:47 ` Jan Kiszka 2011-07-13 21:05 ` Andreas Färber 0 siblings, 1 reply; 9+ messages in thread From: Jan Kiszka @ 2011-07-12 7:47 UTC (permalink / raw) To: andrzej zaborowski; +Cc: Andreas Färber, qemu-devel, Gerd Hoffmann On 2011-07-04 20:15, andrzej zaborowski wrote: > On 26 June 2011 11:11, Jan Kiszka <jan.kiszka@web.de> wrote: >> 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. > > Would it be enough to just do this for x or y, not both? Yes, looks like. Is this one better? Jan ----------8<--------- From: Jan Kiszka <jan.kiszka@siemens.com> For unknown reasons, Windows drivers (tested with XP and Win7) ignore usb-tablet events that move the pointer to 0/0. So always report 0/0 as 1/0. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> --- hw/usb-hid.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/hw/usb-hid.c b/hw/usb-hid.c index d711b5c..faf91c4 100644 --- a/hw/usb-hid.c +++ b/hw/usb-hid.c @@ -459,6 +459,11 @@ static void usb_pointer_event_combine(USBPointerEvent *e, int xyrel, } else { e->xdx = x1; e->ydy = y1; + /* Windows drivers do not like the 0/0 position and ignore such + * events. */ + if (!(x1 | y1)) { + x1 = 1; + } } e->dz += z1; } -- 1.7.3.4 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH v2] usb-hid: Fix 0/0 position for Windows in tablet mode 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 0 siblings, 1 reply; 9+ messages in thread From: Andreas Färber @ 2011-07-13 21:05 UTC (permalink / raw) To: Jan Kiszka; +Cc: François Revol, qemu-devel Developers, Gerd Hoffmann Am 12.07.2011 um 09:47 schrieb Jan Kiszka: > On 2011-07-04 20:15, andrzej zaborowski wrote: >> On 26 June 2011 11:11, Jan Kiszka <jan.kiszka@web.de> wrote: >>> 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. >> >> Would it be enough to just do this for x or y, not both? > > Yes, looks like. Is this one better? To me it looks better, yes. Thanks, Andreas > ----------8<--------- > > From: Jan Kiszka <jan.kiszka@siemens.com> > > For unknown reasons, Windows drivers (tested with XP and Win7) ignore > usb-tablet events that move the pointer to 0/0. So always report 0/0 > as > 1/0. > > Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> > --- > hw/usb-hid.c | 5 +++++ > 1 files changed, 5 insertions(+), 0 deletions(-) > > diff --git a/hw/usb-hid.c b/hw/usb-hid.c > index d711b5c..faf91c4 100644 > --- a/hw/usb-hid.c > +++ b/hw/usb-hid.c > @@ -459,6 +459,11 @@ static void > usb_pointer_event_combine(USBPointerEvent *e, int xyrel, > } else { > e->xdx = x1; > e->ydy = y1; > + /* Windows drivers do not like the 0/0 position and ignore > such > + * events. */ > + if (!(x1 | y1)) { > + x1 = 1; > + } > } > e->dz += z1; > } > -- > 1.7.3.4 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH v2] usb-hid: Fix 0/0 position for Windows in tablet mode 2011-07-13 21:05 ` Andreas Färber @ 2011-07-30 5:51 ` andrzej zaborowski 0 siblings, 0 replies; 9+ messages in thread From: andrzej zaborowski @ 2011-07-30 5:51 UTC (permalink / raw) To: Andreas Färber Cc: François Revol, Jan Kiszka, qemu-devel Developers, Gerd Hoffmann On 13 July 2011 23:05, Andreas Färber <andreas.faerber@web.de> wrote: > Am 12.07.2011 um 09:47 schrieb Jan Kiszka: > >> On 2011-07-04 20:15, andrzej zaborowski wrote: >>> >>> On 26 June 2011 11:11, Jan Kiszka <jan.kiszka@web.de> wrote: >>>> >>>> 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. >>> >>> Would it be enough to just do this for x or y, not both? >> >> Yes, looks like. Is this one better? I pushed this version, thanks. Cheers ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2011-07-30 5:51 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 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
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).