[PATCH 18/20] xkb: Fix a check for MASTER_KEYBOARD

Benjamin Tissoires tissoire at cena.fr
Fri Feb 18 01:48:10 PST 2011


Hi Peter,

On 02/18/2011 04:52 AM, Peter Hutterer wrote:
> Signed-off-by: Peter Hutterer<peter.hutterer at who-t.net>
> ---
>   xkb/xkb.c |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/xkb/xkb.c b/xkb/xkb.c
> index 43d847a..169c604 100644
> --- a/xkb/xkb.c
> +++ b/xkb/xkb.c
> @@ -5831,6 +5831,7 @@ ProcXkbGetKbdByName(ClientPtr client)
>       if (reported&XkbGBN_GeometryMask)
>   	XkbSendGeometry(client,new->geom,&grep,FALSE);
>       if (rep.loaded) {
> +	DeviceIntPtr		master;
>   	XkbDescPtr		old_xkb;
>   	xkbNewKeyboardNotify 	nkn;
>   	int 			i,nG,nTG;
> @@ -5883,9 +5884,8 @@ ProcXkbGetKbdByName(ClientPtr client)
>   	    nkn.changed|= XkbNKN_GeometryMask;
>   	XkbSendNewKeyboardNotify(dev,&nkn);
>
> -	if (!IsMaster(dev)&&  !IsFloating(dev))
> +	if (!IsMaster(dev)&&  (master = GetMaster(dev, MASTER_KEYBOARD)))

I had a quick watch on the series, and this line worries me: I all the 
time consider putting an affectation in a test as a bug (or source of 
bug) as it's ambiguous. I know that it's valid in this case, but I don't 
like it.

Sorry for the noise if you consider this as valid. ;)

Cheers,
Benjamin

>   	{
> -	    DeviceIntPtr master = dev->u.master;
>   	    if (master->u.lastSlave == dev)
>   	    {
>   		XkbCopyDeviceKeymap(dev->u.master, dev);



More information about the xorg-devel mailing list