On Monday, August 30, 2010, Peter Hutterer <[email protected]> wrote:
> The properties cannot match up in height _and_ width, only one of the two.
> Which one depends on the TwinView settings.
>
> We also require that at least one resolution matches the screen resolution
> and that neither of the values is larger than the screen resolution for the
> given dimension.
>
> Signed-off-by: Peter Hutterer <[email protected]>
> ---
> On Sun, Aug 29, 2010 at 06:06:47PM -0700, Ping Cheng wrote:
>> On Friday, August 27, 2010, Peter Hutterer <[email protected]> wrote:
>> > The properties cannot match up in height _and_ width, only one of the two.
>>
>> Although only one set is usable at a time, we may still want to
>> safeguard both sets since both sets are writable props by the client
>> no matter which one matches.
>
> something like this then?
Yeah. But if you are going to remove TwinView next round, there may be
no need to update this patchset any more.
Ping
> src/wcmXCommand.c | 31 ++++++++++++++++++++++++++++---
> 1 files changed, 28 insertions(+), 3 deletions(-)
>
> diff --git a/src/wcmXCommand.c b/src/wcmXCommand.c
> index ed14de5..6c01ecf 100644
> --- a/src/wcmXCommand.c
> +++ b/src/wcmXCommand.c
> @@ -835,19 +835,44 @@ int wcmSetProperty(DeviceIntPtr dev, Atom property,
> XIPropertyValuePtr prop,
> } else if (property == prop_tv_resolutions)
> {
> CARD32 *values;
> + int width, height;
>
> if (prop->size != 4 || prop->format != 32)
> return BadValue;
>
> values = (CARD32*)prop->data;
>
> + width = screenInfo.screens[0]->width;
> + height = screenInfo.screens[0]->height;
> +
> /* 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) ||
> - ((values[0] + values[2]) !=
> screenInfo.screens[0]->width) ||
> - ((values[1] + values[3]) !=
> screenInfo.screens[0]->height))
> + (values[1] < 0) || (values[2] < 0) ||
> (values[3] < 0))
> return BadValue;
>
> + switch(priv->twinview)
> + {
> + case TV_NONE: break;
> + case TV_ABOVE_BELOW:
> + case TV_BELOW_ABOVE:
> + if ((values[1] + values[3]) != height)
> + return BadValue;
> + if (values[0] != width && values[2] !=
> width)
> + return BadValue;
> + if (values[0] > width || values[2] >
> width)
> + return BadValue;
> + break;
> + case TV_LEFT_RIGHT:
> + case TV_RIGHT_LEFT:
> + if ((values[0] + values[2]) != width)
> + return BadValue;
> + if (values[1] != height && values[3] !=
> height)
> + return BadValue;
> + if (values[1] > height || values[3] >
> height)
> + return BadValue;
> + break;
> + }
> +
> if (!checkonly)
> {
> priv->tvResolution[0] = values[0];
> --
> 1.7.2.2
>
>
------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users
worldwide. Take advantage of special opportunities to increase revenue and
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel