summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2008-06-12 11:23:10 +0930
committerPeter Hutterer <peter@cs.unisa.edu.au>2008-06-12 11:24:04 +0930
commit998f52010f92dc79f2ace6048a2f3fd600a97582 (patch)
tree4822cdec0405c9af16849dabba09afcdfab96444 /src
parentde07c04f5c2874b8e407913c3121e715e46653d2 (diff)
Finalize MB emulation if EvdevProbe fails.
This avoids segfaults when HAL is restarted behind our backs. Also, only init MB emulation when the device actually has a button.
Diffstat (limited to 'src')
-rw-r--r--src/evdev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/evdev.c b/src/evdev.c
index 4d20b76..65b7185 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -941,6 +941,7 @@ EvdevProbe(InputInfoPtr pInfo)
if (TestBit(BTN_LEFT, key_bitmask)) {
xf86Msg(X_INFO, "%s: Found mouse buttons\n", pInfo->name);
+ EvdevMBEmuPreInit(pInfo);
pEvdev->flags |= EVDEV_BUTTON_EVENTS;
has_buttons = TRUE;
}
@@ -1025,8 +1026,6 @@ EvdevPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
*/
pEvdev->tool = 1;
- EvdevMBEmuPreInit(pInfo);
-
device = xf86CheckStrOption(dev->commonOptions, "Path", NULL);
if (!device)
device = xf86CheckStrOption(dev->commonOptions, "Device", NULL);
@@ -1052,6 +1051,7 @@ EvdevPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
/* parse the XKB options during kbd setup */
if (EvdevProbe(pInfo)) {
+ EvdevMBEmuFinalize(pInfo);
xf86DeleteInput(pInfo, 0);
return NULL;
}