Index: hw/xfree86/input/mouse/mouse.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/input/mouse/mouse.c,v retrieving revision 1.22 diff -u -p -r1.22 mouse.c --- hw/xfree86/input/mouse/mouse.c 15 Dec 2005 00:19:54 -0000 1.22 +++ hw/xfree86/input/mouse/mouse.c 10 Jan 2006 17:25:14 -0000 @@ -2084,6 +2084,9 @@ MouseDoPostEvent(InputInfoPtr pInfo, int pMse = pInfo->private; + change = buttons ^ pMse->lastMappedButtons; + pMse->lastMappedButtons = buttons; + /* Do single button double click */ if (pMse->doubleClickSourceButtonMask) { if (buttons & pMse->doubleClickSourceButtonMask) { @@ -2108,14 +2111,13 @@ MouseDoPostEvent(InputInfoPtr pInfo, int * processed as a normal button as well. */ buttons &= ~(pMse->doubleClickSourceButtonMask); + change &= ~(pMse->doubleClickSourceButtonMask); } if (pMse->emulateWheel) { /* Emulate wheel button handling */ wheelButtonMask = 1 << (pMse->wheelButton - 1); - change = buttons ^ pMse->lastMappedButtons; - if (change & wheelButtonMask) { if (buttons & wheelButtonMask) { /* Start timeout handling */ @@ -2203,6 +2205,7 @@ MouseDoPostEvent(InputInfoPtr pInfo, int * the timeout code. */ buttons &= ~wheelButtonMask; + change &= ~wheelButtonMask; } if (pMse->emulate3ButtonsSoft && pMse->emulate3Pending && (dx || dy)) @@ -2211,9 +2214,7 @@ MouseDoPostEvent(InputInfoPtr pInfo, int if (dx || dy) xf86PostMotionEvent(pInfo->dev, 0, 0, 2, dx, dy); - if (buttons != pMse->lastMappedButtons) { - - change = buttons ^ pMse->lastMappedButtons; + if (change) { /* * adjust buttons state for drag locks! @@ -2314,7 +2315,6 @@ MouseDoPostEvent(InputInfoPtr pInfo, int (buttons & (1 << (id - 1))), 0, 0); } - pMse->lastMappedButtons = buttons; } }