Index: programs/Xserver/hw/xfree86/common/xf86Configure.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/common/xf86Configure.c,v retrieving revision 1.16 diff -u -3 -p -r1.16 xf86Configure.c --- programs/Xserver/hw/xfree86/common/xf86Configure.c 14 Nov 2005 18:49:30 -0000 1.16 +++ programs/Xserver/hw/xfree86/common/xf86Configure.c 15 Nov 2005 01:53:24 -0000 @@ -320,6 +320,8 @@ configureInputSection (void) #endif mouse->inp_option_lst = xf86addNewOption(mouse->inp_option_lst, "ZAxisMapping", "4 5 6 7"); + mouse->inp_option_lst = + xf86addNewOption(mouse->inp_option_lst, "Emulate3Buttons", "false"); ptr = (XF86ConfInputPtr)xf86addListItem((glp)ptr, (glp)mouse); return ptr; } Index: programs/Xserver/hw/xfree86/input/mouse/mouse.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/input/mouse/mouse.c,v retrieving revision 1.19 diff -u -3 -p -r1.19 mouse.c --- programs/Xserver/hw/xfree86/input/mouse/mouse.c 14 Nov 2005 14:25:09 -0000 1.19 +++ programs/Xserver/hw/xfree86/input/mouse/mouse.c 15 Nov 2005 01:53:24 -0000 @@ -399,9 +399,12 @@ MouseCommonOptions(InputInfoPtr pInfo) pMse->emulate3Buttons = xf86SetBoolOption(pInfo->options, "Emulate3Buttons", FALSE); - if (!xf86FindOptionValue(pInfo->options,"Emulate3Buttons")) + + if (!xf86FindOptionValue(pInfo->options,"Emulate3Buttons")) { pMse->emulate3ButtonsSoft = TRUE; - + pMse->emulate3Buttons = TRUE; + } + pMse->emulate3Timeout = xf86SetIntOption(pInfo->options, "Emulate3Timeout", 50); if (pMse->emulate3Buttons || pMse->emulate3ButtonsSoft) { @@ -2027,7 +2030,14 @@ Emulate3ButtonsSoft(InputInfoPtr pInfo) buttonTimer(pInfo); xf86Msg(X_INFO,"3rd Button detected: disabling emulate3Button\n"); - + + /* + * Now that we know we have a middle button, remove the Wakeup + * and Block handlers. + */ + RemoveBlockAndWakeupHandlers (MouseBlockHandler, MouseWakeupHandler, + (pointer) pInfo); + return FALSE; } @@ -3650,9 +3660,6 @@ SetMouseProto(MouseDevPtr pMse, MousePro if ((pMse->protocolID >= 0) && (pMse->protocolID < PROT_NUMPROTOS)) memcpy(pMse->protoPara, proto[pMse->protocolID], sizeof(pMse->protoPara)); - - if (pMse->emulate3ButtonsSoft) - pMse->emulate3Buttons = TRUE; } /*