On Mon, Aug 30, 2010 at 06:13:07PM +0100, Przemo Firszt wrote:
> Dnia 2010-08-30, pon o godzinie 10:50 +1000, Peter Hutterer pisze:
> > On Fri, Aug 27, 2010 at 03:29:56PM +0100, Przemo Firszt wrote:
> > > Dnia 2010-08-27, piÄ… o godzinie 13:47 +1000, Peter Hutterer pisze:
> > > > A CARD32 is unsigned and cannot be less than 0. Remove the checks and
> > > > move
> > > > the one leftover check down to the switch statement.
> > > > ---
> > > > src/wcmXCommand.c | 7 ++-----
> > > > 1 files changed, 2 insertions(+), 5 deletions(-)
> > > >
> > > > diff --git a/src/wcmXCommand.c b/src/wcmXCommand.c
> > > > index 9e1b5fa..40afe60 100644
> > > > --- a/src/wcmXCommand.c
> > > > +++ b/src/wcmXCommand.c
> > > > @@ -842,13 +842,10 @@ int wcmSetProperty(DeviceIntPtr dev, Atom
> > > > property, XIPropertyValuePtr prop,
> > > > values = (CARD32*)prop->data;
> > > >
> > > > /* non-TwinView settings can not set TwinView
> > > > RESOLUTION */
> > > > - if ((priv->twinview == TV_NONE) || (values[0] < 0) ||
> > > > - (values[1] < 0) || (values[2] < 0) ||
> > > > (values[3] < 0))
> > > > - return BadValue;
> > > > -
> > > > switch(priv->twinview)
> > > > {
> > > > - case TV_NONE: break;
> > > > + case TV_NONE:
> > > > + return BadValue;
> > > > case TV_ABOVE_BELOW:
> > > > case TV_BELOW_ABOVE:
> > > > if ((values[1] + values[3]) !=
> > > > screenInfo.screens[0]->height)
> > > Hi Peter,
> > > xsetwacom --get "WACOM Pen Tablet stylus" TwinView none still works, but
> >
> > "set" or "get"?
> "set", my fault.
> >
> > > with this patch gives an error message. Do we really want to return
> > > BadValue here?
> >
> > this patch should only return a BadValue if you're trying to set
> > TVResolution when TwinView is off. arguably you should be able to set it
> > either way but regardless of which order, we'd have to deal with missing
> > error checks. So I picked this one for now (note that I have a patch in my
> > devel branch removing TwinView altogether so this is a bit moot anyway)
> >
> > also, xsetwacom is a bit broken for TVResolution, you need to set it
> > manually with xinput. (the last patch fixes that though)
> OK, makes no difference if TwinView is on it's way out of the code.
my apologies, I had my > 30 local branches mixed up and was working on a
different one. The patch attached fixes the issue.
Cheers,
Peter
>From 6a359efdb0fb656b8ee051600313f1faa043a0b7 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <[email protected]>
Date: Mon, 6 Sep 2010 13:36:03 +1000
Subject: [PATCH] Allow 0 for TwinView resolution if TwinView is NONE.
Signed-off-by: Peter Hutterer <[email protected]>
---
src/wcmXCommand.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/wcmXCommand.c b/src/wcmXCommand.c
index c1566dd..30e6a4d 100644
--- a/src/wcmXCommand.c
+++ b/src/wcmXCommand.c
@@ -848,7 +848,10 @@ int wcmSetProperty(DeviceIntPtr dev, Atom property,
XIPropertyValuePtr prop,
switch(priv->twinview)
{
case TV_NONE:
- return BadValue;
+ if (values[0] || values[1] ||
+ values[2] || values[3])
+ return BadValue;
+ break;
case TV_ABOVE_BELOW:
case TV_BELOW_ABOVE:
if ((values[1] + values[3]) != height)
--
1.7.2.2
------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:
Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel