Commit on xserver 1.11 stable branch but not on master?

Chase Douglas chase.douglas at canonical.com
Sat Feb 11 07:58:49 PST 2012


On 02/11/2012 09:18 AM, Peter Hutterer wrote:
> On Sat, Feb 11, 2012 at 12:01:47AM +0100, Chase Douglas wrote:
>> Peter,
>>
>> While updating our frankenserver (1.11 stable + 1.12 input) I came
>> across this commit on server-1.11-stable branch:
>>
>> 4b386610243b1a30db7e4cdb89cb43012198407d dix: button state must show the
>> logical buttons, not physical buttons
>>
>> It says it's cherry-picked from
>> 9567d21e85b99febe805263a4d93b15fd1f7ab42, but I can't find that on the
>> master branch, and the code change doesn't appear to be there either. Do
>> you know what happened here?
> 
> hmm, I wonder if it got rebased after I cherry-picked. not good. The
> upstream commit appears to be fcda98c48610fd507ca0b89c6006a5497d9dc1c9, I've
> added that to the bug now too.

I think there are three hunks that are at issue. The first is the fix
for master in dix/inpututils.c:

--- a/dix/inpututils.c
+++ b/dix/inpututils.c
@@ -674,7 +674,7 @@ void event_set_state(DeviceIntPtr mouse,
DeviceIntPtr kbd, DeviceEvent *event)

     for (i = 0; mouse && mouse->button && i <
mouse->button->numButtons; i++)
         if (BitIsOn(mouse->button->down, i))
-            SetBit(event->buttons, i);
+            SetBit(event->buttons, mouse->button->map[i]);

     if (mouse && mouse->touch && mouse->touch->buttonsDown > 0)
         SetBit(event->buttons, mouse->button->map[1]);

This ^^ is only on master. I grepped for numButtons in dix/inpututils.c
on server-1.11-branch and didn't find anything. The second hunk is the
fix for server-1.11-branch in Xi/exevents.c:

--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -927,7 +927,7 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr
device)

     for (i = 0; mouse && mouse->button && i <
mouse->button->numButtons; i++)
         if (BitIsOn(mouse->button->down, i))
-            SetBit(event->buttons, i);
+            SetBit(event->buttons, mouse->button->map[i]);

     if (kbd && kbd->key)
     {

This ^^ is only on server-1.11-branch. I think the code moved during our
XI 2.2 efforts. However, there's a third section of code on master that
looks like it needs fixing. This is in DeviceFocusEvent in Xi/exevents.c:

    for (i = 0; mouse && mouse->button && i < mouse->button->numButtons;
i++)
        if (BitIsOn(mouse->button->down, i))
            SetBit(&xi2event[1], i);

This last unfixed line is why I thought the fix wasn't applied to
master. I found it in Xi/exevents.c by grepping for numButtons and
assumed it was the location of what was fixed on server-1.11-branch.

I'll send a patch to fix this shortly.

Thanks!

-- Chase


More information about the xorg-devel mailing list