From 1df6716281579e2937743d840ab1079343c503ac Mon Sep 17 00:00:00 2001 From: Adam Tkac Date: Mon, 23 Feb 2009 09:28:26 +1000 Subject: [PATCH] xfree86: don't try to UnInit virtual devices in DIDR. (#20087) DeleteInputDeviceRequest function doesn't handle "virtual" devices well. TightVNC libvnc.so module to X (which makes bare Xorg VNC capable) uses such kind of devices. Bare Xvnc (it is something like Xvfb) simply uses AddInputDevice & RegisterDevice functions. Xvnc uses DeleteInputDeviceRequest from Xi/stubs.c so everything works fine (now I see that DeleteInputDeviceRequest in Xi/stubs.c should call RemoveDevice function, shouldn't it? :) ) Situation is quite different when you use libvnc.so module. It uses same schema as Xvnc, so it simply calls AddInputDevice & RegisterDevice. Thus device is created correctly. When server is terminated it calls DeleteInputDeviceRequest (now from hw/xfree86/common/xf86Xinput.c) for each device. Here is the difference - Xvnc calls DeleteInputDeviceRequest from Xi/stubs.c as I wrote above. Thus Xorg gets sigsegv because "VNC" devices don't have real input driver. X.Org Bug 20087 [This isn't really a fix (libVNC should behave correctly) but not crashing the server sounds like an improvement.] Signed-off-by: Peter Hutterer --- hw/xfree86/common/xf86Xinput.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 59b616cb8..df1ecb913 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -720,7 +720,7 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev) OsBlockSignals(); RemoveDevice(pDev); - if (!isMaster) + if (!isMaster && pInfo != NULL) { if(drv->UnInit) drv->UnInit(drv, pInfo, 0);