X server testing

Thomas Jaeger thjaeger at gmail.com
Mon Jun 22 08:34:02 PDT 2009


Peter Hutterer wrote:
>> From a25ed91b3c08f3e8e46c0a23ea61e905b86c16c7 Mon Sep 17 00:00:00 2001
>> From: Thomas Jaeger <ThJaeger at gmail.com>
>> Date: Sun, 14 Jun 2009 13:58:39 -0400
>> Subject: [PATCH] reattach: Default to return to VCP/VCK when returnMode is AttachToMaster
>>
>> Signed-off-by: Thomas Jaeger <ThJaeger at gmail.com>
>> ---
>>  src/hierarchy.c |   38 ++++++++++++++++++++++++++++++++++++--
>>  src/xinput.c    |    2 +-
>>  2 files changed, 37 insertions(+), 3 deletions(-)
>>
>> +        if (!r.return_pointer || !r.return_keyboard) {
>> +            int i, ndevices;
>> +            info = XIQueryDevice(dpy, XIAllMasterDevices, &ndevices);
>> +            for(i = 0; i < ndevices; i++) {
>> +                if (info[i].use == XIMasterPointer && !r.return_pointer)
>> +                    r.return_pointer = info[i].deviceid;
>> +                if (info[i].use == XIMasterKeyboard && !r.return_keyboard)
>> +                    r.return_keyboard = info[i].deviceid;
>> +                if (return_pointer && return_keyboard)
>                         ^^ your compiler must be better than mine. :)
> 
Sorry, I forgot to re-format-patch after actually testing the patch.

>> +                    break;
>> +            }
>> +
>> +            XIFreeDeviceInfo(info);
>> +        }
>>      }
>>  
>>      ret = XIChangeHierarchy(dpy, (XIAnyHierarchyChangeInfo*)&r, 1);
>> diff --git a/src/xinput.c b/src/xinput.c
>> index 007fe2c..7c47c3c 100644
>> --- a/src/xinput.c
>> +++ b/src/xinput.c
>> @@ -87,7 +87,7 @@ static entry drivers[] =
>>        create_master
>>      },
>>      { "remove-master",
>> -      "<id> [returnMode (dflt:Floating)] [returnPointer] [returnKeyboard]",
>> +      "<id> [returnMode (dflt:Floating, AttachToMaster)] [returnPointer] [returnKeyboard]",
>>        remove_master
>>      },
>>      { "reattach",
> 
> I just noticed this hunk is wrong, shouldn't be in there. The default return
> mode is still "floating" (for better or worse). The new behaviour should be
> documented in the man page, which I just noticed doesn't exist for these
> options yet.
Still, even if the behavior is documented in the man page, --help should
document what a valid input is.  Maybe I didn't choose the right syntax,
but it should be evident from --help that you can choose between
Floating and AttachToMaster.

How about "<id> [Floating || AttachToMaster (dflt:Floating)]
[returnPointer] [returnKeyboard]" ?

> fixed up the build error, removed the last hunk. Pushed as
> e8ca8fa459eb2eb4d9e9faf294d7172fb4fdb17b.
Thanks,

Tom



More information about the xorg-devel mailing list